dc_progarray()

This forum is for eXpress++ general support.
Post Reply
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

dc_progarray()

#1 Post by c-tec »

Hello Roger,
have a strange problem. The attached source Testcode 1 does not work when calling the first time I start the program:

Code: Select all

aTmp := dc_progarray(cSource)
if !empty(aTmp)
     dc_interpret(aTmp,aVar)
endif
When I remove some parts like in Testcode 2 it works. After this changes also the first code does work if I interpret the original code. So both versions are working without problems. With dc_interpret(cSource,aVar) it generally does not work. When I restart the program, I get again the error in dc_progarray() "Program Stucture Error at Line: 11".
Any idea what's going wrong ?
Regards
Rudolf


Testsource 1

Code: Select all

cTest := "test"
for x :=1 to 10
	cTest += str(x)
next x
wmeld(cTest)
if len(cTest) # 0
	wmeld("ok")
else
	wmeld("not ok")
endif
Testcode2

Code: Select all

cTest := "test"
//for x :=1 to 10
//	cTest += str(x)
//next x
wmeld(cTest)
//if len(cTest) # 0
//	wmeld("ok")
//else
//	wmeld("not ok")
//endif
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: dc_progarray()

#2 Post by c-tec »

Hello,
forgot to mention: the same code works when I make a normal function from it
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_progarray()

#3 Post by rdonnay »

Try this:

Code: Select all

for x := 1 to 10
Instead of this:

Code: Select all

for x :=1 to 10
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: dc_progarray()

#4 Post by c-tec »

Hello Roger,
does also not work, but after playing around I found that when I remove all if else endif, the code works. It seems that there is a problem with if endif or do case structures.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: dc_progarray()

#5 Post by c-tec »

Hello Roger,
found it ! It is not allowed to use endif, with end it works.
Regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

Post Reply