|
Post by jarychk on Jul 22, 2022 6:31:56 GMT
Program does not run, stopping on a long code line using array elements and space$() spaces. JB says, "TYPE-MISMACTH". I cannot find it.
'print i,vdate$(i),vpurpo$(i),vway$(i),vmomove$(i),vbal$(i) print i;space$(6);vdate$(i);space$(len(vdate$(i)-10));vpurpo$(i);space$(len(vpurpo$(i))-35);vway$(i);space$(len(vway$(i))-8);vmomove$(i);space$(len(vmomove$(i))-15);vbal$(i)
|
|
|
Post by jarychk on Jul 22, 2022 7:43:59 GMT
I still never yet figured what was the "Type Mismatch" but this here code line does work and works correctly:
for i=1 to rx print i;space$(12);vdate$(i);space$(15-len(vdate$(i)));vpurpo$(i);space$(35-len(vpurpo$(i)));vway$(i);space$(8-len(vway$(i)));vmomove$(i);space$(15-len(vmomove$(i)));vbal$(i) next i
|
|
|
Post by Rod on Jul 22, 2022 7:53:13 GMT
Your second space$() argument has the bracket in the wrong place space$(len(vdate$(i)-10)) space$(len(vdate$(i))-10)
|
|
|
Post by jarychk on Jul 22, 2022 8:07:49 GMT
Your second space$() argument has the bracket in the wrong place space$(len(vdate$(i)-10)) space$(len(vdate$(i))-10) What I was doing inside space$() was creating trouble. We found how to adjust at about the same time. (The expressions inside needed to be turned around). I still do not know how a type-mismatch was happening. What I finally wrote for the program in my JB in fact looks different than the two lines you quote here above.
|
|
|
Post by Rod on Jul 22, 2022 11:11:19 GMT
The code I posted is from the very first code line you posted. The reason you got a type mismatch was the misplaced bracket.
If you get this kind of thing again break the line down into shorter sections till you find which fragment isn’t working. That’s what I did to find the bracket misplacement.
|
|