assign and declare variables

Post Reply
User avatar
Silvio.Falconi
Posts: 7187
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 9 times

assign and declare variables

Post by Silvio.Falconi »

If I load a variable as

Code: Select all | Expand

 &cVarName := cVarValue
I must declare before cvarname ?

I explain you

I take the variables from a extern file sample

Code: Select all | Expand

FUNCTION ReadFile()
    local cFileName := "table_1.dat"
    local aInfo := ReadProtectedFile(cFileName)
    local aItem,cVarName,cVarValue

FOR EACH aItem IN aInfo
    cVarName := aItem[1]
    cVarValue := aItem[2]

         &cVarName := cVarValue
NEXT


      ?c8

    RETURN NIL
When I load the file I can Know how many variables there are into

for example if there are 3 variables their names will be c1,c2,c3

How I must declare these variables before to assign the cVarValue ?

Must I use memvar?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Post Reply