The time now is Mon 23 Apr 2018, 15:20
All times are UTC - 4 |
Author |
Message |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Mon 04 Mar 2013, 01:11 Post subject:
|
|
Thanks Mobeus,
Yea, I finally figured that part out my sloppy coding
I think I have it working now, however, I need the program to wait, halt, or stop until the MSGDIALOG decision is made (ie. wait until either the 'yes' or the 'no' button are pushed; or the window is closed indicating not to delete the record)
At present, it continues execution while the MSGDIALOG is present, continuing on to the 'END SUB'. Here is what I have atm (kmv is now being returned ):
Code: |
killmsg$=CONCAT$(Are yo usure you want to delete ",kilme$," ?")
kilme_dlg=MSGDIALOG(killmsg$,300,110,1,4)
SHOW(kilme_dlg)
CALLBACK(kilme_dlg,killme_btn)
IF kmv = 1 THEN
GOTO findrec
END IF
GOTO nokill
LABEL findrec
PRINT "at finding record"
LABEL nokill
PRINT "ending"
END SUB
|
'ending' is being printed while the MSGDIALOG is being shown. I click the 'yes' button,GUI hides, then nothing happens. I re-click the button on the gui to go into the delete SUB and then the 'at finding record' prints followed by the 'ending' message while the new MSGDIALOG is being shown.
I'm familiar with the 'WAIT' command, but how and where do you set it up to pause the program until the MSGDIALOG buttons are pressed?
I am thinking of trying this:
Code: |
dmv = 3
REPEAT
SHOW(kilme_dlg)
CALLBACK(kilme_dlg,killme_btn)
dmv=WAIT(killme_btn, 30)
UNTIL dmv < 3
|
OR
Code: |
dmv = 3
WHILE dmv >= 3
SHOW(kilme_dlg)
CALLBACK(kilme_dlg,killme_btn)
WEND
|
It is late here, so I will try them and post what happens in the next few minutes or so. Then Ima going to bed!
Thanks!
E
.
[UPDATE]
Both failed
Using the WHILE/WEND method caused the MSGDIALOG window to pop up with nothing inside it and locked the system up. Strike one
Using the REPEAT/UNTIL with 'dmv=WAIT(kilme_dlg,30)' would not compile due to a segmentation fault. Strike Two
Using REPEAT/UNTIL with 'dmv=WAIT(killme_btn,30)' would not compile due to an integer from pointer error. Strike three- I'm out!
Well, off to bed...I'll see what happens with it tomorrow. Meanwhile, any solutions , feel free to post them for me
Thanks all!
E
.
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Tue 05 Mar 2013, 12:11 Post subject:
pausing to get MSGDIALOG input (solved?) Subject description: how I got the message dialog button input to register |
|
Hey all,
Well, after a couple of days working at it, I finally got the result I was looking for. Here is how I got the program to 'pause' until the MSGDIALOG button was pressed:
Code: |
killmsg$=CONCAT$("Are yo sure you want to delete record ",kilme$," ?")
kill_dlg=MSGDIALOG(killmsg$,300,100,1,4)
SHOW(kill_dlg)
CALLBACK(kill_dlg,killit)
END SUB
SUB killit (NUMBER kill_dlg, int button)
HIDE(kill_dlg)
IF button = GTK_RESPONSE_YES THEN
CALL kilrec
END IF
END SUB
SUB kilrec
PRINT "killing record"
END SUB
|
I want to thank all those who helped me understand how this works. All the responses and inputs were very helpful!
Thanks!
E
.
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Wed 06 Mar 2013, 12:49 Post subject:
manufacturer db completed Subject description: small flat-file db for manufacturer contacts |
|
Hey guys,
Finally completed my first BaCon prog! Wo0h0o!
@L18L
Thought you might want to give it a look over with the international finished on it (I hope ). So here's the whole thing, the prog, the code, and the '.pot' file. Hope you like it! Fair warning, the code is going to be repdative and at times jumpy - but like I said, my first in Bacon
Thanks!
E
.
Description |
small flat-file manufacturer contact list/db
|

Download |
Filename |
manuf_prog_bacon.tar.gz |
Filesize |
147.36 KB |
Downloaded |
447 Time(s) |
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Wed 06 Mar 2013, 12:49 Post subject:
manufacturer db completed Subject description: small flat-file db for manufacturer contacts |
|
Hey guys,
Finally completed my first BaCon prog! Wo0h0o!
@L18L
Thought you might want to give it a look over with the international finished on it (I hope ). So here's the whole thing, the prog, the code, and the '.pot' file. Hope you like it! Fair warning, the code is going to be repeatative and at times jumpy - but like I said, my first in Bacon
Thanks!
E
.
Description |
small flat-file manufacturers contact list/ database
|

Download |
Filename |
manuf_prog_bacon.tar.gz |
Filesize |
147.36 KB |
Downloaded |
448 Time(s) |
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1447 Location: Ukraine
|
Posted: Sun 17 Mar 2013, 12:01 Post subject:
|
|
Dear all,
I have been doing a bit of label and svg coding recently and most of the examples are at http://basic-converter.proboards.com/index.cgi?board=doc&action=display&thread=314&page=3.
I was impressed with SFR's recent DYCP script and did a BaCon port/mod. Here is the source and a Lucid 32-bit binary.
With kind regards,
vovchik
Description |
|

Download |
Filename |
bmw-demo.tar.gz |
Filesize |
22.71 KB |
Downloaded |
419 Time(s) |
Description |
|
Filesize |
16.07 KB |
Viewed |
590 Time(s) |

|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Sun 17 Mar 2013, 13:41 Post subject:
Re: manufacturer db completed Subject description: small flat-file db for manufacturer contacts |
|
e_mattis wrote: | ...look over with the international finished on it (I hope ). So here's the whole thing, the prog, the code, and the '.pot' file.... |
Good news first:
Internationalization is working
(translation of NY, NC, ... does not make sense )
Bad news:
prog and code do not match:
Code: | # bacon manuf.bac
Converting 'manuf.bac'... done.
Compiling 'manuf.bac'... Compiler emits messages!
Problem:
file 'manuf.bac' line 9: GLOBAL valu$,manunam$,contpsn$,street$,city$,state$,zip$ TYPE STR
Cause:
expected '=', ',', ';', 'asm' or '__attribute__' before 'valu$'
# |
REM INCLUDE "/usr/share/BaCon/hug.bac"
INCLUDE "/usr/share/BaCon/hug_imports.bac"
is converting faster
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Sun 17 Mar 2013, 16:36 Post subject:
|
|
Hey L18L
Thanks for the review.
Quote: | Bad news:
prog and code do not match: |
hmm, not sure why 'valu$' is there. I don't remember using it anywhere. May be a typo that can be removed? Compiles and runs on my system either way.
Thanks!
E
.
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Mon 18 Mar 2013, 06:33 Post subject:
manuf Subject description: puppy version |
|
e_mattis wrote: | ... Compiles and runs on my system either way.... |
So your system is not racy 5.5.1
If have changed to slacko and there it compiles and runs.
Translations tend to need more length than english.
Idea for the buttons:
frame named Entry
and default gtk stock buttons for add remove edit save (and quit)
Description |
|
Filesize |
27.65 KB |
Viewed |
655 Time(s) |

|
|
Back to top
|
|
 |
Mobeus

Joined: 26 Aug 2010 Posts: 94
|
Posted: Mon 18 Mar 2013, 13:23 Post subject:
|
|
Hi E,
I'm a little surprised that it builds on slacko. Using the latest bacon beta and hug.bac here I get the same compile error as L18L, and it should.
There is no TYPE STR in bacon, it's TYPE STRING.
After changing those it builds fine.
Regards,
Mobeus
_________________ /root for the home team
|
Back to top
|
|
 |
e_mattis

Joined: 20 Dec 2012 Posts: 114 Location: Williamston, SC
|
Posted: Mon 18 Mar 2013, 17:17 Post subject:
|
|
Hey guys,
no, it's not Racy, it's Precise
As you can tell, i'm not accustomed to making "international" programs...didn't think about the wording and the different lengths, my bad
I guess i'm telling my age as the saying goes...the 'TYPE STR' comes from a basic long ago Rather surprised it compiled using just that. Thanks for the heads-up!
I have noticed one 'bug' issue - and i'm sure it's in my coding somehow. When you add multi-records (more than two or three) and then try to remove one, it either crashes or removes the entire database Am working on that now, but can not seem to remember/figure out how to remove a certain record and re-assign the remaining ones. ( i.e remove record #3 of a 5 record list). Hopefully I will have it figured out soon (thinking of doing it in another 'while,wend' statement), but, meanwhile, any input would be appreciated
Thanks again for the inputs !
E
.
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Tue 19 Mar 2013, 06:46 Post subject:
|
|
Mobeus wrote: | Hi E,
I'm a little surprised that it builds on slacko. Using the latest bacon beta and hug.bac here I get the same compile error as L18L, and it should.
There is no TYPE STR in bacon, it's TYPE STRING.
After changing those it builds fine.
Regards,
Mobeus |
good catch!
looking in my source I see now:
I had removed TYPE STR because all those variables had a trailing [b]$[/b].
Sorry, nobody is perfect
|
Back to top
|
|
 |
PaulR
Joined: 04 May 2005 Posts: 249 Location: UK
|
Posted: Wed 10 Apr 2013, 14:03 Post subject:
|
|
Can anyone suggest a fix for this please? I'm executing a shell command to search for a named file starting from "/".
If I execute the following line in a terminal it works as expected:
find / -name icon.xpm -and -not -path /proc
but if filename$="icon.xpm" and I do the following in a BaCon program, the find command still looks in /proc (and returns no such file/directory errors)
command$ = "find / -name " & filename$ & " -and -not -path /proc"
result$=EXEC$(command$)
I've also tried putting /proc in quotes (both by escaping double quotes and using CHR$) and using "proc" and even "/proc/*" both with and without quotes.
I've looked into -prune as an alternative but I'm struggling to understand it at present!
Cheers
Paul
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1447 Location: Ukraine
|
Posted: Wed 10 Apr 2013, 14:21 Post subject:
|
|
Dear Paul,
This code, which is yours, compiles fine and runs OK, i.e. no errors:
Code: | filename$ = "icon.xpm"
command$ = "find / -name " & filename$ & " -and -not -path /proc"
result$=EXEC$(command$)
PRINT result$ |
I don't have any problems with it.
With kind regards,
vovchik
|
Back to top
|
|
 |
PaulR
Joined: 04 May 2005 Posts: 249 Location: UK
|
Posted: Wed 10 Apr 2013, 14:38 Post subject:
|
|
vovchik
If I run the code many times with different filenames I start to get errors like this:
find: `/proc/24007': No such file or directory
find: `/proc/24008': No such file or directory
find: `/proc/24009': No such file or directory
Just in case you haven't noticed, the program/problem is explained in these two threads..
http://murga-linux.com/puppy/viewtopic.php?t=85526
http://murga-linux.com/puppy/viewtopic.php?t=85563
Basically I'm extracting menu entries from .jwmrc and writing them out to a file in Fluxbox format. The new file is created properly (including the icon filenames) but these errors are annoying!
Many thanks,
Paul
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5087 Location: Arizona, U.S.A.
|
Posted: Wed 10 Apr 2013, 15:32 Post subject:
|
|
If I`m not mistaken, isn`t CONCAT$ required to combine literal and variable strings in Bacon?
Like this:
Code: | filename$ = "icon.xpm"
command$ = CONCAT$("find / -type f -name ", filename$)
result$=EXEC$(command$)
PRINT result$ |
# PaulR; If you reduce the "find" to /usr or whatever you`re looking for, it be quicker.
Also, I think you`ll find that shell scripts are much better at doing strings.
And you end up needed the shell to interface with the O.S. and file systems anyway.
.
Last edited by sunburnt on Wed 10 Apr 2013, 15:36; edited 1 time in total
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|