Posted By: Grat
carefull with string from algo - 06/17/20 13:50
Hi,
I want use Algo name in my struct. But I i get this:
ALGO= test
ALGO= price
ALGO= worm
ALGO= sup
name in 0 isallOther
name in 1 isallOther
name in 2 isallOther
name in 3 isallOther
Finish test!
Logout.. ok
source code:
correct is this:
pdata[i].cName=strf("%s",Algo);
I want use Algo name in my struct. But I i get this:
Quote
ALGO= test
ALGO= price
ALGO= worm
ALGO= sup
name in 0 isallOther
name in 1 isallOther
name in 2 isallOther
name in 3 isallOther
Finish test!
Logout.. ok
source code:
Code
typedef struct{ var dLong; // var dShort; string cName; }PDATA; PDATA pdata[4]; void resetPdata(){ int i=0; while (algo(loop("test","price","worm","sup"))){ pdata[i].cName=(string)Algo; printf("\nALGO= %s",pdata[i].cName); i++; } } function run(){ if (is(INITRUN)) resetPdata(); algo("allOther"); int i=0; for (i=0; i< 4;i++) printf("\n name in %d is%s",i,pdata[i].cName); quit("\n Finish test!"); }
correct is this:
pdata[i].cName=strf("%s",Algo);