[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gambas script capabilities
[Thread Prev] | [Thread Next]
- Subject: Re: Gambas script capabilities
- From: "olivier.cruilles" <olivier.cruilles@xxxxxxxx>
- Date: Sat, 10 Oct 2026 13:34:11 +0000
- To: Bruce Steers <bsteers4@xxxxxxxxx>, Gambas Mailing List <user@xxxxxxxxxxxxxxxxxxxxxx>
Hi,I found the problem.1. I load the orignal script (script .gbs generated by gbs3 --convert-project <path to gambas projet>) (size 822 Bytes) in a TextEditor2. I enable the TextEditor1.Highlight = "gambas" and that change the structure of the original text in the TextEditor. It's clearly mentioned in the documentation of Gambas (https://gambaswiki.org/wiki/comp/gb.form.editor/texteditor/highlight)3. I save the Text of the TextEditor using File.Save() or TextEdit1.Save() but the highlighted text is saved (size 849 Bytes), and that break the script.If I do the same procedure without enabling the TextEditor.Highlight, the script saved is the same as the original.The question now is, how get the raw text from the TextEditor and not the Highlighted text (modified text), and it is possible ?Thank you all with your helpOlivierLe 10 octobre 2026, à 01:41, Bruce Steers <bsteers4@xxxxxxxxx> a écrit:To preserve the existing file authorisations when opening note the Stat and restore it when saving. hStat As Stat = Stat(sFilename)Then when it's saved..File Save(sPath, sData)Chmod sPath To hStat AuthYou can also restore user and group from the Stat if neededChown sPath To hStat UserChgrp sPath To hStat GroupOr you can use shell. chmod +x filenameOr for testing just run in a terminal adding gbs3$ gbs3 filenameThat way it does not need the #!/shebang or to be marked executable.BruceSOn Fri, 9 Oct 2026, 22:21 olivier.cruilles, <olivier.cruilles@xxxxxxxx> wrote:Hi Brian,I found the issue, it's on my side.If I edit the script generated by gbs3 into my Editor and if I save it with File.Save() function, apparently it break something.I'm investigating what does File.Save() to break the internal structure of the original file.Thank you for you answerOlivier CruillesLe 9 octobre 2026, à 17:00, Brian G <brian@xxxxxxxxxxxxxxxx> a écrit: On 10/9/26 11:29, Olivier Cruilles wrote: Hello everyone, I’m currently testing a little more Gambas Scripting capabilities and I would like to have your opinion please. As I remember, it was possible to create simple graphic application into a *.gbs script but trying to convert a simple Graphic App ‘Hello world' into a simple Form + a button Quit -> to a script .gbs using the command ‘gbs3 —convert-project /path/to/helloword/app’ , produce a script .gbs file but it does not work when I run it. Just to clarify if it’s really possible have simple graphic forms into a .gbs script or not at all ? Thank you Olivier I hope this helps Olivier, as I said send my you project I can have a look Attached is the source project Here is the command i used to convert it gbs3 --convert-project /home/brian/test/ProjToScr /home/brian/bin Here is the script it created --------------------------------------------------------------- cut here ------------------------------------------------------------------- #!/usr/bin/env gbs3 'Auto Generated Script 10/09/2026 20:52:12.101 Version (3.22.99) #Script Startup="FMain" #Script Version="0.0.1" Use "gb.image" Use "gb.gui" Use "gb.form" class FMain ' Gambas class file End class form FMain # Gambas Form File 3.0 { Form Form MoveScaled(0,0,64,22) { TextLabel1 TextLabel MoveScaled(4,5,49,11) Font = Font["Noto Mono,Spacing=1.5,+6"] Text = ("hello world") } } End form ------------------------------------------------------------------ cut here ----------------------------------------------------------------- Here is what appears on screen when run -- ~~~~ Brian
| Re: Gambas script capabilities | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
| Re: Gambas script capabilities | Bruce Steers <bsteers4@xxxxxxxxx> |
| Gambas script capabilities | Olivier Cruilles <olivier.cruilles@xxxxxxxx> |
| Re: Gambas script capabilities | Brian G <brian@xxxxxxxxxxxxxxxx> |
| Re: Gambas script capabilities | "olivier.cruilles" <olivier.cruilles@xxxxxxxx> |
| Re: Gambas script capabilities | Bruce Steers <bsteers4@xxxxxxxxx> |