|
Post by SunBurnt on Feb 16, 2013 8:19:27 GMT 1
The main Bacon page has bacon and it`s docs, but no current hug download.
I got bacon29 and docs, and hug83 ( latest? ) and what about it`s docs.?
I`m getting a persistent error in the working hug apps I wrote.
Problem: file '/root/0_BaCon/BaCon/hug.bac' line 1074: IF ctr > 0 AND ptr != NULL THEN hug_text$ = CONCAT$(hug_text$, " ") Cause: expected expression before '=' token
|
|
|
Post by Pjot on Feb 16, 2013 9:21:44 GMT 1
Hi Sunburnt, The HUG docs are here. My existing applications work fine, can you elaborate on your code? BR, Peter
|
|
|
Post by SunBurnt on Feb 16, 2013 21:19:56 GMT 1
Thanks Peter. I`m sure you know the error is in the GRAB$ function. Here`s one of the test apps I wrote a long time ago, it errors, but it doesn`t use GRAB$
INCLUDE "/root/0_BaCon/BaCon/hug.bac",INIT,DISPLAY,WINDOW,MARK,COMBO,ATTACH,TIMEOUT,SET,GET,TEXT INIT
SUB Set_Choice SET(cboTest_, GET(cboTest_)) END SUB
win_ = WINDOW(" Combo Test", 100, 100)
lblTest_ = MARK("Test", 80, 25) ATTACH(win_, lblTest_, 10, 10)
cboTest_ = COMBO("Item #0", 80, 25) ATTACH(win_, cboTest_, 10, 50)
FOR i = 1 TO 5 TEXT(cboTest_, CONCAT$("Item #", STR$(i))) NEXT
SET(cboTest_, 0)
TIMEOUT(1000, Set_Choice)
DISPLAY
# Wouldn`t it be good to have the latest HUG and docs on the main Bacon web page also? .
|
|
|
Post by Pjot on Feb 16, 2013 21:44:23 GMT 1
Hi Sunburnt,
This program compiles and runs fine on my system. I do not see a problem with GRAB$ anyway...?
They are, and always have been, on the main BaCon site.
BR, Peter
|
|
|
Post by SunBurnt on Feb 17, 2013 8:24:27 GMT 1
Sorry, I finally found hug under the language extensions by noticing the hug_imports link.
I guess there`s something wrong with my Pentium-D PC. When I rearrange the code I posted, it sometimes produces other errors.
But add a TEXT line in the SUB and add GRAB$ to the include:
SUB Set_Choice SET(cboTest_, GET(cboTest_)) TEXT(lblTest_, GRAB$(cboTest_)) END SUB Then it always produces the error I posted. SET works with GET, and TEXT works with GRAB$. Correct?
I compiled this simple test code and it errors the same also:
INCLUDE "/root/0_BaCon/BaCon/hug.bac",INIT,DISPLAY,WINDOW,MARK,BUTTON,ATTACH,CALLBACK,TEXT,GRAB$ INIT
SUB CLICK TEXT(lbl_, GRAB$(btn_)) END SUB
win_ = WINDOW(" Button Test.", 100, 100)
lbl_ = MARK("", 80, 25)) ATTACH(win_, btn_, 10, 10)
btn_ = BUTTON("Button", 80, 25) ATTACH(win_, btn_, 10, 60) : CALLBACK(btn_, CLICK)
DISPLAY
This is simple stuff so it`s frustrating wrestling with it instead of just writing code. .
|
|
|
Post by Pjot on Feb 17, 2013 8:41:54 GMT 1
Hi Sunburnt,
This program contains two errors, if you correct them it will work fine.
(1) First this line:
lbl_ = MARK("", 80, 25))
There is a ')' too much here.
(2) Then the line right after:
ATTACH(win_, btn_, 10, 10)
The 'btn_' variable is still empty here, so it should be 'lbl_'.
After these corrections the program works.
Yes. Also that code snippet works fine for me.
BR, Peter
|
|
|
Post by SunBurnt on Feb 17, 2013 9:25:30 GMT 1
I just booted to a different Puppy version and the "line 1074" error is gone. I should have checked this earlier, many Puppies with many makers. This is with the same bacon and hug files, so no problem with them.
Thanks Peter, I caught the errors in the button code. It didn`t like the two duplicate attach commands. But in the first Puppy it never got that far so I didn`t see them until now.
Thanks for the support, it`s always appreciated!
|
|