Re: G4C - hard to spot Script error
"flicknemo" <[email protected]>
| Newsgroups | gmane.comp.windows.gui4cli |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the added infomation, Frans, which I am sure will be useful to many. I will try it out soon, and report here if it does not work for me. Cheerio, Flicknemo --- In [email protected], "Marianne" <marianne976@...> wrote: > > Hi Flicknemo > > The ":" is mentioned in the files area of the manual. What I do is to add the following in the load event of my main gui for example: > > .Location = $$This.path > > I use the "." to make the variable global. > > Then if I load for example an image or any other file, I use the following format: > > Load image "$.Location/mypic.jpg" mypic > > It also work in a Gui4cli executable file. > > > Regards > > Frans > ===================== > > > > --- In [email protected], "flicknemo" <flicknemo@> wrote: > > > > G4C - hard to spot error > > > > > > Hi All, > > > > This must be a common error in g4c script, which I made and it was very hard to see what is wrong. > > The message from the debugger was this : > > ~~~~~~~~~~~~~~~ > > > > *ERROR* File: "C:/Program Files/Gui4Cli/MytestProgs/Imagefuncs/Image show.gui" Line: 22 > > Item was not found, MYPIC > > ~~~~~~~~~~~~~~~ > > > > and the offending line, > > > > 22 GuiOpen #this > > was referring to the earlier : > > ~~~~~~~~~~~~~~~ > > > > Image load 'TBEmbossedt.jpg' mypic > > ~~~~~~~~~~~~~~~ > > which failed to load the image before the gui opens and paints itself. > > > > I had wrongly assumed Gui4Cli 'knew' to look in the gui folder for the image. I knew this image was there, for I opened it with another viewer. > > > > I found out the enquoted filename needs either the full G4C path of the file or : > > ~~~~~~~~~~~~~~~ > > > > ':TBEmbossedt.jpg' > > ':/TBEmbossedt.jpg' > > ~~~~~~~~~~~~~~~ > > > > Either of the above correctly places the image file in the current gui's own folder hence the script runs now, and displays my image. > > > > I hope this will save you a lot of annoyance with this hard to spot error. Probably it is best to paste the correctly spelled line into any new gui you write, then simply edit to change the filename. You will avoid the typo error that way. > > > > flicknemo at yahoo dot com > > > ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/gui4cli/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/gui4cli/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/