Re: [Gambas-user] reading files
thanks tony sounds like just what i needed i will take a look cheers On 19/07/17 22:34, Tony Morehen wrote: I've attached an archive containing the code I use to read v1 and v2 MP3 tags and other MP3 info including bitrates (fixed and VBR), sampling rates and number of channels. v1 tags are pretty staightforward to read if you don't try to read the structure directly, but by each element of the structure at a time. Some tips: 1) Numeric elements (bytes, bytearrays, shorts, integers, longs) can be read directly from the stream. ie (4 byte Integer) = Read #Stream As Integer. Gambas can handle little endian/big endian issues. 2) Fixed length strings must be handled in a two stage process. First, the required string length number of bytes is read into a byte array. This byte array is then converted to a string. Sample code: Dim Bytes As New Byte[StringLength] Bytes.Read(Stream) FixedString = Bytes.ToString() Note: Bytes.ToString stops the string conversion at the first null or at the end of the array. Therfore, you don't have to worry about null-terminated strings. v2 tags are more complicated, particularly since the tags can be ascii, either kind of utf16, or utf8 encoding. The code I sent has been tested with over 10,000 mp3 files has seems to have no issues. On 2017-07-19 12:33 AM, Shane wrote: thank you Gian i did take a rest and read but alas it did not help as far as i see it he is saying don't use binary file for fixed length strings but as this is an mp3 file tag witch i have no control i am doomed On 18/07/17 19:22, Gianluigi wrote: Why do not you take a moment of rest and read what Tobias Boege recommend me in the discussion [0] I told you here [1]? [0] http://gambas.8142.n7.nabble.com/Random-access-files-with-fixed-length-string-td50880.html [1] http://gambas.8142.n7.nabble.com/vb-code-td59764.html 2017-07-18 9:04 GMT+02:00 Shane: I am very confused from the docs _Variable_ *= READ* [ *#* _Stream_ ] *AS* _Datatype_ _Variable_ *= READ* [ *#* _Stream_ *,* ] _Length_ so wouldn't it be_ _ IDtag = read #hfile as ID3v1_TAG ? with doesn't work by the way On 18/07/17 12:44, nand...@nothingsimple.com wrote: I think Read #hfile, IDtag, ID3v1_TAG should be Read #hfile, IDtag as ID3v1_TAG -- Open WebMail Project (http://openwebmail.org) -- Original Message --- From: Shane To: gambas-user@lists.sourceforge.net Sent: Tue, 18 Jul 2017 10:50:43 +1000 Subject: Re: [Gambas-user] reading files i don't know what i am doing wrong Public Struct ID3v1_TAG '(128 bytes) Tag[3] As String 'always TAG Title[30] As String 'title, 30 characters Artist[30] As String 'artist, 30 characters Album[30] As String 'album, 30 characters Year[4] As String 'year, 4 characters Comment[30] As String 'comment, 30 characters (or 28 if track# included) Genre As Byte 'genre, 255 for none defined End Struct Private Sub GetID3v1(File As String) Dim IDtag As ID3v1_TAG Dim hfile As File hfile = Open File For Read ' 'read the tag ' seek to end of less tag size Read #hfile, IDtag, ID3v1_TAG here i get IDtag is NULL On 18/07/17 05:05, nand...@nothingsimple.com wrote: Yes it is possible, I do it. here is some code (incomplete) -Nando (Canada) ' top of class file Public Struct recstruc _a as integer _b as integer _c as integer end struct ' a function public function openAfile(filename as string) as file dim hfile as file dim arec as recstruc hfile = open filename for read write create with arec 'some values to write. ._a = 1 ._b = 22 ._c = 333 end with write #hfile, arec as recstruc 'if you position the hfile pointer back to zero, you can... read #hfile, arec as recstruc close #hfile end -- Open WebMail Project (http://openwebmail.org) -- Original Message --- From: T Lee Davidson To: gambas-user@lists.sourceforge.net Sent: Sun, 16 Jul 2017 12:42:35 -0400 Subject: Re: [Gambas-user] reading files On 07/16/2017 06:57 AM, Shane wrote: given this example PRIVATE SUB BinaryRead(FilePath AS String) DIM binaryFile AS File DIM i AS Integer DIM b AS Byte DIM s AS Short DIM s1 AS String DIM s2 AS String ' Read binary file binaryFile = OPEN FilePath FOR READ READ #binaryFile, i READ #binaryFile, b READ #binaryFile, s READ #binaryFile, s1 READ #binaryFile, s2 CLOSE #binaryFile ' Display results PRINT i PRINT b PRINT s PRINT s1 PRINT s2 END is there a way for gambas to read a struct of all these variables in one read ? You may have hinted at the solution within your question.
Re: [Gambas-user] Gambas-user Digest, Vol 134, Issue 54
> i like it:! > but, alas, KDE and Ubuntu implementations are mutually incompatible! Well done guys > totally right!!, that's why i dont like such stupid thing and changes.. > Lenz McKAY Gerardo (PICCORO) > http://qgqlochekone.blogspot.com > 2017-07-19 16:19 GMT-04:00 Fabien Bodard: > you need to use the gb.gui.trayicon component > > http://gambaswiki.org/wiki/comp/gb.gui.trayicon > > witch support all the protocols Fabien I did what you suggested and it does not work for me. Show me the following message FMain.ArrangeTray.28: QXcbWindow: Unhandled client message: "_NET_WM_DESKTOP" QXcbWindow: Unhandled client message: "_KDE_WM_CHANGE_STATE" FMain.ArrangeTray.28: QXcbWindow: Unhandled client message: "_NET_SYSTEM_TRAY_OPCODE" > > 2017-07-19 18:40 GMT+02:00 PICCORO McKAY Lenz : > > 2017-07-19 12:35 GMT-04:00 herberth guzman : > > > >> I know that KDE 5 dropped the support for the old system tray protocol. > >> > > the gnome-puach also dropped some about it.. > > > > i think that this component must have a citation that oly works with > normal > > desktops.. like lxde and mate.. > > openbox+fbpanel and lxde still use the old/today behaviour.. why follow > > those desktops that want to change everithig are working? > > > > > >> > >> It is possible to temporarily run the system tray, please. > >> > >> > >> Thanks > >> > >> > >> Herberth Guzman > >> > >> -- > >> Check out the vibrant tech community on one of the world's most > >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot > >> ___ > >> Gambas-user mailing list > >> Gambas-user@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/gambas-user > >> > > > -- > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > ___ > > Gambas-user mailing list > > Gambas-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > -- > Fabien Bodard 2017-07-19 14:28 GMT-06:00 : > Send Gambas-user mailing list submissions to > gambas-user@lists.sourceforge.net > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/gambas-user > or, via email, send a message with subject or body 'help' to > gambas-user-requ...@lists.sourceforge.net > > You can reach the person managing the list at > gambas-user-ow...@lists.sourceforge.net > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Gambas-user digest..." > > > Today's Topics: > >1. Re: Pre-release of Gambas 3.10.0 (herberth guzman) >2. Re: Pre-release of Gambas 3.10.0 (PICCORO McKAY Lenz) >3. Re: Pre-release of Gambas 3.10.0 (herberth guzman) >4. Re: Pre-release of Gambas 3.10.0 (PICCORO McKAY Lenz) >5. Re: Pre-release of Gambas 3.10.0 (Fabien Bodard) >6. Re: Pre-release of Gambas 3.10.0 (PICCORO McKAY Lenz) > > > -- > > Message: 1 > Date: Wed, 19 Jul 2017 10:10:14 -0600 > From: herberth guzman > To: gambas-user > Subject: Re: [Gambas-user] Pre-release of Gambas 3.10.0 > Message-ID: >
[Gambas-user] [Gambas Bug Tracker] Bug #1128: Message.Question should return -1 on cancel
http://gambaswiki.org/bugtracker/edit?object=BUG.1128=L21haW4- Comment #2 by C THAL: Ok, thank you all. I did not see it because I just saw http://gambaswiki.org/wiki/comp/gb.form/message (linked from inside the IDE). -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Pre-release of Gambas 3.10.0
Thank you Benoit, here it seems to work well. Regards Gianluigi [System] Gambas=3.10 OperatingSystem=Linux Kernel=4.4.0-83-generic Architecture=x86 Distribution=Ubuntu 16.04.2 LTS Desktop=XFCE Theme=Cleanlooks Language=it_IT.UTF-8 Memory=3018M 2017-07-18 17:56 GMT+02:00 Benoît Minisini via Gambas-user < gambas-user@lists.sourceforge.net>: > Hi, > > I have just uploaded the source tarball of Gambas 3.10 on Sourceforge: > > https://sourceforge.net/projects/gambas/files/gambas3/gambas > 3-3.10.0.tar.bz2/download > > Can people test it and report any problem before I make the release public? > > Thanks in advance! > > -- > Benoît Minisini > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] [Gambas Bug Tracker] Bug #1128: Message.Question should return -1 on cancel
Thal, you could take a look at this discussion [0] Regards Gianluigi [0] http://gambas.8142.n7.nabble.com/MessageBox-problem-td56154.html#a56231 2017-07-19 15:33 GMT+02:00 Tony Morehen: > That is the documented behaviour: > > All Message functions can have up to three buttons: > > * > >The first button is always the default button. > > * > >The last button is always the cancel button. > > > On 2017-07-19 09:20 AM, bugtrac...@gambaswiki.org wrote: > >> http://gambaswiki.org/bugtracker/edit?object=BUG.1128=L21haW4- >> >> C THAL reported a new bug. >> >> Summary >> --- >> >> Message.Question should return -1 on cancel >> >> Type : Bug >> Priority : Medium >> Gambas version : 3.9.90 (TRUNK) >> Product : Language >> >> >> Description >> --- >> >> Message.Question returns 2 if the message window was closed or canceled >> via . >> >> That is bad, especially if there are two buttons and the action should >> not be default, but on button two, like so: >> >> Dim ret as integer >> >> ret = Message.Question("Do you really want to delete all?", "No", "Yes") >> >> >> -- >> >> If the user cancels or closes the window of the message it returns 2! All >> will be deleted ... >> >> >> >> >> >> >> -- >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> ___ >> Gambas-user mailing list >> Gambas-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/gambas-user >> > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] reading files
A very interesting work Regards Gianluigi 2017-07-19 14:34 GMT+02:00 Tony Morehen: > I've attached an archive containing the code I use to read v1 and v2 MP3 > tags and other MP3 info including bitrates (fixed and VBR), sampling rates > and number of channels. v1 tags are pretty staightforward to read if you > don't try to read the structure directly, but by each element of the > structure at a time. Some tips: > > 1) Numeric elements (bytes, bytearrays, shorts, integers, longs) can be > read directly from the stream. ie (4 byte Integer) = Read #Stream As > Integer. Gambas can handle little endian/big endian issues. > > 2) Fixed length strings must be handled in a two stage process. First, the > required string length number of bytes is read into a byte array. This > byte array is then converted to a string. Sample code: > > Dim Bytes As New Byte[StringLength] > Bytes.Read(Stream) > FixedString = Bytes.ToString() > > Note: Bytes.ToString stops the string conversion at the first null or at > the end of the array. Therfore, you don't have to worry about > null-terminated strings. > > v2 tags are more complicated, particularly since the tags can be ascii, > either kind of utf16, or utf8 encoding. The code I sent has been tested > with over 10,000 mp3 files has seems to have no issues. > > > On 2017-07-19 12:33 AM, Shane wrote: > >> thank you Gian i did take a rest and read but alas it did not help >> >> as far as i see it he is saying don't use binary file for fixed length >> strings >> >> but as this is an mp3 file tag witch i have no control i am doomed >> >> >> >> On 18/07/17 19:22, Gianluigi wrote: >> >>> Why do not you take a moment of rest and read what Tobias Boege recommend >>> me in the discussion [0] I told you here [1]? >>> >>> [0] >>> http://gambas.8142.n7.nabble.com/Random-access-files-with-fi >>> xed-length-string-td50880.html >>> [1] http://gambas.8142.n7.nabble.com/vb-code-td59764.html >>> >>> 2017-07-18 9:04 GMT+02:00 Shane : >>> >>> I am very confused from the docs _Variable_ *= READ* [ *#* _Stream_ ] *AS* _Datatype_ _Variable_ *= READ* [ *#* _Stream_ *,* ] _Length_ so wouldn't it be_ _ IDtag = read #hfile as ID3v1_TAG ? with doesn't work by the way On 18/07/17 12:44, nand...@nothingsimple.com wrote: I think > Read #hfile, IDtag, ID3v1_TAG > should be > Read #hfile, IDtag as ID3v1_TAG > > > -- > Open WebMail Project (http://openwebmail.org) > > > -- Original Message --- > From: Shane > To: gambas-user@lists.sourceforge.net > Sent: Tue, 18 Jul 2017 10:50:43 +1000 > Subject: Re: [Gambas-user] reading files > > i don't know what i am doing wrong > >> Public Struct ID3v1_TAG '(128 bytes) >> Tag[3] As String 'always TAG >> Title[30] As String 'title, 30 characters >> Artist[30] As String 'artist, 30 characters >> Album[30] As String 'album, 30 characters >> Year[4] As String 'year, 4 characters >> Comment[30] As String 'comment, 30 characters (or 28 >> if >> track# included) >> Genre As Byte 'genre, 255 for none defined >> End Struct >> >> Private Sub GetID3v1(File As String) >>Dim IDtag As ID3v1_TAG >>Dim hfile As File >> >>hfile = Open File For Read >> >>' >>'read the tag >>' seek to end of less tag size >> >>Read #hfile, IDtag, ID3v1_TAG >> >> here i get IDtag is NULL >> >> On 18/07/17 05:05, nand...@nothingsimple.com wrote: >> >> Yes it is possible, I do it. here is some code (incomplete) >>> >>> -Nando (Canada) >>> >>> >>> >>> ' top of class file >>> Public Struct recstruc >>> _a as integer >>> _b as integer >>> _c as integer >>> end struct >>> >>> >>> ' a function >>> public function openAfile(filename as string) as file >>> >>> dim hfile as file >>> dim arec as recstruc >>> >>> hfile = open filename for read write create >>> >>> with arec 'some values to write. >>> ._a = 1 >>> ._b = 22 >>> ._c = 333 >>> end with >>> >>> write #hfile, arec as recstruc >>> >>> 'if you position the hfile pointer back to zero, you can... >>> read #hfile, arec as recstruc >>> >>> close #hfile >>> >>> end >>> >>> >>> >>> >>> >>> >>> -- >>> Open WebMail Project (http://openwebmail.org) >>> >>> >>> -- Original Message --- >>> From: T Lee Davidson
Re: [Gambas-user] Pre-release of Gambas 3.10.0
i like it:! > but, alas, KDE and Ubuntu implementations are mutually incompatible! Well done guys totally right!!, that's why i dont like such stupid thing and changes.. Lenz McKAY Gerardo (PICCORO) http://qgqlochekone.blogspot.com 2017-07-19 16:19 GMT-04:00 Fabien Bodard: > you need to use the gb.gui.trayicon component > > http://gambaswiki.org/wiki/comp/gb.gui.trayicon > > witch support all the protocols > > 2017-07-19 18:40 GMT+02:00 PICCORO McKAY Lenz : > > 2017-07-19 12:35 GMT-04:00 herberth guzman : > > > >> I know that KDE 5 dropped the support for the old system tray protocol. > >> > > the gnome-puach also dropped some about it.. > > > > i think that this component must have a citation that oly works with > normal > > desktops.. like lxde and mate.. > > openbox+fbpanel and lxde still use the old/today behaviour.. why follow > > those desktops that want to change everithig are working? > > > > > >> > >> It is possible to temporarily run the system tray, please. > >> > >> > >> Thanks > >> > >> > >> Herberth Guzman > >> > >> -- > >> Check out the vibrant tech community on one of the world's most > >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot > >> ___ > >> Gambas-user mailing list > >> Gambas-user@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/gambas-user > >> > > > -- > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > ___ > > Gambas-user mailing list > > Gambas-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-user > > > > -- > Fabien Bodard > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Pre-release of Gambas 3.10.0
you need to use the gb.gui.trayicon component http://gambaswiki.org/wiki/comp/gb.gui.trayicon witch support all the protocols 2017-07-19 18:40 GMT+02:00 PICCORO McKAY Lenz: > 2017-07-19 12:35 GMT-04:00 herberth guzman : > >> I know that KDE 5 dropped the support for the old system tray protocol. >> > the gnome-puach also dropped some about it.. > > i think that this component must have a citation that oly works with normal > desktops.. like lxde and mate.. > openbox+fbpanel and lxde still use the old/today behaviour.. why follow > those desktops that want to change everithig are working? > > >> >> It is possible to temporarily run the system tray, please. >> >> >> Thanks >> >> >> Herberth Guzman >> >> -- >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> ___ >> Gambas-user mailing list >> Gambas-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/gambas-user >> > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user -- Fabien Bodard -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Pre-release of Gambas 3.10.0
2017-07-19 12:35 GMT-04:00 herberth guzman: > I know that KDE 5 dropped the support for the old system tray protocol. > the gnome-puach also dropped some about it.. i think that this component must have a citation that oly works with normal desktops.. like lxde and mate.. openbox+fbpanel and lxde still use the old/today behaviour.. why follow those desktops that want to change everithig are working? > > It is possible to temporarily run the system tray, please. > > > Thanks > > > Herberth Guzman > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Pre-release of Gambas 3.10.0
My system tray does not work with gb.qt5. I remember you had it run in revision # 7098 I know that KDE 5 dropped the support for the old system tray protocol. It is possible to temporarily run the system tray, please. Thanks Herberth Guzman -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Pre-release of Gambas 3.10.0
2017-07-19 12:10 GMT-04:00 herberth guzman: > "Web Form Application" > (You can create Web Form) > ah right its missing of can at least choose/convert the cgi to a mix of cgi and form and let user removed manually if not want any of forms seems something of gtk2 are removed? i only can see gtk3 or i forget something in compliation!? > > > Herberth Guzman > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Pre-release of Gambas 3.10.0
Regards Benoit In the menu New Project, the list of the types of applications that we want to create are shown, example: Application QT (Application using the component QT5 or QT4) Application GTK+ 3 (pplication using the component GTK+3) Application Web (Scrip CGI). It is possible to create a new one that says: "Web Form Application" (You can create Web Form) Herberth Guzman -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Pre-release of Gambas 3.10.0
Hi Benoît, I wanted to ask you what were the component changes since the last release. I am on an exchange in Germany and couldn't really follow the progress on this development cycle. Specifically, any added or removed components. And any changes of dependencies. With that information, and as soon as I have time, I will update the PPAs. Regards, Sebastian On Tue, Jul 18, 2017 at 5:56 PM, Benoît Minisini via Gambas-user < gambas-user@lists.sourceforge.net> wrote: > Hi, > > I have just uploaded the source tarball of Gambas 3.10 on Sourceforge: > > https://sourceforge.net/projects/gambas/files/gambas3/gambas > 3-3.10.0.tar.bz2/download > > Can people test it and report any problem before I make the release public? > > Thanks in advance! > > -- > Benoît Minisini > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] [Gambas Bug Tracker] Bug #1128: Message.Question should return -1 on cancel
http://gambaswiki.org/bugtracker/edit?object=BUG.1128=L21haW4- Comment #1 by PICCORO LENZ MCKAY: That is the documented behaviour: >All Message functions can have up to three buttons: > * The first button is always the default button. > * The last button is always the cancel button. http://gambaswiki.org/wiki/comp/gb.qt4/message and for tony, it must be answered in the bugtracker.. the nex time, i'll make now but take in consideration that the next time: PICCORO LENZ MCKAY changed the state of the bug to: Invalid. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] [Gambas Bug Tracker] Bug #1128: Message.Question should return -1 on cancel
That is the documented behaviour: All Message functions can have up to three buttons: * The first button is always the default button. * The last button is always the cancel button. On 2017-07-19 09:20 AM, bugtrac...@gambaswiki.org wrote: http://gambaswiki.org/bugtracker/edit?object=BUG.1128=L21haW4- C THAL reported a new bug. Summary --- Message.Question should return -1 on cancel Type : Bug Priority : Medium Gambas version : 3.9.90 (TRUNK) Product : Language Description --- Message.Question returns 2 if the message window was closed or canceled via . That is bad, especially if there are two buttons and the action should not be default, but on button two, like so: Dim ret as integer ret = Message.Question("Do you really want to delete all?", "No", "Yes") -- If the user cancels or closes the window of the message it returns 2! All will be deleted ... -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] [Gambas Bug Tracker] Bug #1128: Message.Question should return -1 on cancel
http://gambaswiki.org/bugtracker/edit?object=BUG.1128=L21haW4- C THAL reported a new bug. Summary --- Message.Question should return -1 on cancel Type : Bug Priority : Medium Gambas version : 3.9.90 (TRUNK) Product : Language Description --- Message.Question returns 2 if the message window was closed or canceled via . That is bad, especially if there are two buttons and the action should not be default, but on button two, like so: Dim ret as integer ret = Message.Question("Do you really want to delete all?", "No", "Yes") -- If the user cancels or closes the window of the message it returns 2! All will be deleted ... -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas Playground
a docker to take more overall control to the env (also due to put a good necesary gambas env). good idea (and i not avocate to doker containers.. ) some js are minified make very dificult understand and study the code (special for those that are not experts) as i understand setup a minimal env/docker with gambas, the make a copy/instance of playground-runner and then that runner paly a server playground that server the web interface.. ? Lenz McKAY Gerardo (PICCORO) http://qgqlochekone.blogspot.com 2017-07-19 9:03 GMT-04:00 Adrien Prokopowicz: > Le Wed, 19 Jul 2017 12:15:43 +0200, PICCORO McKAY Lenz < > mckaygerh...@gmail.com> a écrit: > > 2017-07-19 6:11 GMT-04:00 PICCORO McKAY Lenz : >> >> >>> And for the code, I just pushed it to a GitLab repository. You'll find it here : https://gitlab.com/prokopyl/gambas-playground >>> >>> good made, better than the old-comlex svn.. thanks >>> >>> i found seeds and some traces, but have private non-opensource >> repositoryes >> in both github and gilab, please be share/open >> >> does not gambas are open/free software for you ? give same back to >> community .. thanks in advance! >> >> > The repository I linked was indeed private, that was not intended. > It is now fixed, everyone should now be able to access it. > > > Regards, > -- > Adrien Prokopowicz > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas Playground
Le Wed, 19 Jul 2017 12:15:43 +0200, PICCORO McKAY Lenza écrit: 2017-07-19 6:11 GMT-04:00 PICCORO McKAY Lenz : And for the code, I just pushed it to a GitLab repository. You'll find it here : https://gitlab.com/prokopyl/gambas-playground good made, better than the old-comlex svn.. thanks i found seeds and some traces, but have private non-opensource repositoryes in both github and gilab, please be share/open does not gambas are open/free software for you ? give same back to community .. thanks in advance! The repository I linked was indeed private, that was not intended. It is now fixed, everyone should now be able to access it. Regards, -- Adrien Prokopowicz -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] reading files
I've attached an archive containing the code I use to read v1 and v2 MP3 tags and other MP3 info including bitrates (fixed and VBR), sampling rates and number of channels. v1 tags are pretty staightforward to read if you don't try to read the structure directly, but by each element of the structure at a time. Some tips: 1) Numeric elements (bytes, bytearrays, shorts, integers, longs) can be read directly from the stream. ie (4 byte Integer) = Read #Stream As Integer. Gambas can handle little endian/big endian issues. 2) Fixed length strings must be handled in a two stage process. First, the required string length number of bytes is read into a byte array. This byte array is then converted to a string. Sample code: Dim Bytes As New Byte[StringLength] Bytes.Read(Stream) FixedString = Bytes.ToString() Note: Bytes.ToString stops the string conversion at the first null or at the end of the array. Therfore, you don't have to worry about null-terminated strings. v2 tags are more complicated, particularly since the tags can be ascii, either kind of utf16, or utf8 encoding. The code I sent has been tested with over 10,000 mp3 files has seems to have no issues. On 2017-07-19 12:33 AM, Shane wrote: thank you Gian i did take a rest and read but alas it did not help as far as i see it he is saying don't use binary file for fixed length strings but as this is an mp3 file tag witch i have no control i am doomed On 18/07/17 19:22, Gianluigi wrote: Why do not you take a moment of rest and read what Tobias Boege recommend me in the discussion [0] I told you here [1]? [0] http://gambas.8142.n7.nabble.com/Random-access-files-with-fixed-length-string-td50880.html [1] http://gambas.8142.n7.nabble.com/vb-code-td59764.html 2017-07-18 9:04 GMT+02:00 Shane: I am very confused from the docs _Variable_ *= READ* [ *#* _Stream_ ] *AS* _Datatype_ _Variable_ *= READ* [ *#* _Stream_ *,* ] _Length_ so wouldn't it be_ _ IDtag = read #hfile as ID3v1_TAG ? with doesn't work by the way On 18/07/17 12:44, nand...@nothingsimple.com wrote: I think Read #hfile, IDtag, ID3v1_TAG should be Read #hfile, IDtag as ID3v1_TAG -- Open WebMail Project (http://openwebmail.org) -- Original Message --- From: Shane To: gambas-user@lists.sourceforge.net Sent: Tue, 18 Jul 2017 10:50:43 +1000 Subject: Re: [Gambas-user] reading files i don't know what i am doing wrong Public Struct ID3v1_TAG '(128 bytes) Tag[3] As String 'always TAG Title[30] As String 'title, 30 characters Artist[30] As String 'artist, 30 characters Album[30] As String 'album, 30 characters Year[4] As String 'year, 4 characters Comment[30] As String 'comment, 30 characters (or 28 if track# included) Genre As Byte 'genre, 255 for none defined End Struct Private Sub GetID3v1(File As String) Dim IDtag As ID3v1_TAG Dim hfile As File hfile = Open File For Read ' 'read the tag ' seek to end of less tag size Read #hfile, IDtag, ID3v1_TAG here i get IDtag is NULL On 18/07/17 05:05, nand...@nothingsimple.com wrote: Yes it is possible, I do it. here is some code (incomplete) -Nando (Canada) ' top of class file Public Struct recstruc _a as integer _b as integer _c as integer end struct ' a function public function openAfile(filename as string) as file dim hfile as file dim arec as recstruc hfile = open filename for read write create with arec 'some values to write. ._a = 1 ._b = 22 ._c = 333 end with write #hfile, arec as recstruc 'if you position the hfile pointer back to zero, you can... read #hfile, arec as recstruc close #hfile end -- Open WebMail Project (http://openwebmail.org) -- Original Message --- From: T Lee Davidson To: gambas-user@lists.sourceforge.net Sent: Sun, 16 Jul 2017 12:42:35 -0400 Subject: Re: [Gambas-user] reading files On 07/16/2017 06:57 AM, Shane wrote: given this example PRIVATE SUB BinaryRead(FilePath AS String) DIM binaryFile AS File DIM i AS Integer DIM b AS Byte DIM s AS Short DIM s1 AS String DIM s2 AS String ' Read binary file binaryFile = OPEN FilePath FOR READ READ #binaryFile, i READ #binaryFile, b READ #binaryFile, s READ #binaryFile, s1 READ #binaryFile, s2 CLOSE #binaryFile ' Display results PRINT i PRINT b PRINT s PRINT s1 PRINT s2 END is there a way for gambas to read a struct of all these variables in one read ? You may have hinted at the solution within your question. Have you considered using a Structure? http://gambaswiki.org/wiki/lang/read : "... reads the stream Stream as
Re: [Gambas-user] reading files
You can take a look at our Italian wiki [0][1][2] using Google Translate. You can also subscribe and ask a question in English, I do not understand mp3, but there is someone who understands it. Regards Gianluigi [0] http://www.gambas-it.org/wiki/index.php?title=Estrarre_informazioni_e_TAG_da_un_file_MP3_con_le_sole_funzioni_di_Gambas [1] http://www.gambas-it.org/wiki/index.php?title=Guide_della_comunit%C3%A0#Gestione_dei_dati_audio_e_dei_file_audio [2] http://www.gambas-it.org/wiki/index.php?title=Guide_della_comunit%C3%A0#Struttur 2017-07-19 6:33 GMT+02:00 Shane: > thank you Gian i did take a rest and read but alas it did not help > > as far as i see it he is saying don't use binary file for fixed length > strings > > but as this is an mp3 file tag witch i have no control i am doomed > > > > On 18/07/17 19:22, Gianluigi wrote: > >> Why do not you take a moment of rest and read what Tobias Boege recommend >> me in the discussion [0] I told you here [1]? >> >> [0] >> http://gambas.8142.n7.nabble.com/Random-access-files-with-fi >> xed-length-string-td50880.html >> [1] http://gambas.8142.n7.nabble.com/vb-code-td59764.html >> >> 2017-07-18 9:04 GMT+02:00 Shane : >> >> I am very confused from the docs >>> >>> _Variable_ *= READ* [ *#* _Stream_ ] *AS* _Datatype_ >>> >>> _Variable_ *= READ* [ *#* _Stream_ *,* ] _Length_ >>> >>> so wouldn't it be_ >>> _ >>> >>> IDtag = read #hfile as ID3v1_TAG ? >>> >>> with doesn't work by the way >>> >>> >>> >>> On 18/07/17 12:44, nand...@nothingsimple.com wrote: >>> >>> I think Read #hfile, IDtag, ID3v1_TAG should be Read #hfile, IDtag as ID3v1_TAG -- Open WebMail Project (http://openwebmail.org) -- Original Message --- From: Shane To: gambas-user@lists.sourceforge.net Sent: Tue, 18 Jul 2017 10:50:43 +1000 Subject: Re: [Gambas-user] reading files i don't know what i am doing wrong > Public Struct ID3v1_TAG '(128 bytes) > Tag[3] As String 'always TAG > Title[30] As String 'title, 30 characters > Artist[30] As String 'artist, 30 characters > Album[30] As String 'album, 30 characters > Year[4] As String 'year, 4 characters > Comment[30] As String 'comment, 30 characters (or 28 > if > track# included) > Genre As Byte 'genre, 255 for none defined > End Struct > > Private Sub GetID3v1(File As String) >Dim IDtag As ID3v1_TAG >Dim hfile As File > >hfile = Open File For Read > >' >'read the tag >' seek to end of less tag size > >Read #hfile, IDtag, ID3v1_TAG > > here i get IDtag is NULL > > On 18/07/17 05:05, nand...@nothingsimple.com wrote: > > Yes it is possible, I do it. here is some code (incomplete) >> >> -Nando (Canada) >> >> >> >> ' top of class file >> Public Struct recstruc >> _a as integer >> _b as integer >> _c as integer >> end struct >> >> >> ' a function >> public function openAfile(filename as string) as file >> >> dim hfile as file >> dim arec as recstruc >> >> hfile = open filename for read write create >> >> with arec 'some values to write. >> ._a = 1 >> ._b = 22 >> ._c = 333 >> end with >> >> write #hfile, arec as recstruc >> >> 'if you position the hfile pointer back to zero, you can... >> read #hfile, arec as recstruc >> >> close #hfile >> >> end >> >> >> >> >> >> >> -- >> Open WebMail Project (http://openwebmail.org) >> >> >> -- Original Message --- >> From: T Lee Davidson >> To: gambas-user@lists.sourceforge.net >> Sent: Sun, 16 Jul 2017 12:42:35 -0400 >> Subject: Re: [Gambas-user] reading files >> >> On 07/16/2017 06:57 AM, Shane wrote: >> >>> given this example PRIVATE SUB BinaryRead(FilePath AS String) DIM binaryFile AS File DIM i AS Integer DIM b AS Byte DIM s AS Short DIM s1 AS String DIM s2 AS String ' Read binary file binaryFile = OPEN FilePath FOR READ READ #binaryFile, i READ #binaryFile, b READ #binaryFile, s READ #binaryFile, s1 READ #binaryFile, s2 CLOSE #binaryFile ' Display results PRINT i PRINT b PRINT s PRINT s1
Re: [Gambas-user] Gambas Playground
2017-07-19 6:11 GMT-04:00 PICCORO McKAY Lenz: > >> And for the code, I just pushed it to a GitLab repository. You'll find it >> here : >> https://gitlab.com/prokopyl/gambas-playground > > good made, better than the old-comlex svn.. thanks > i found seeds and some traces, but have private non-opensource repositoryes in both github and gilab, please be share/open does not gambas are open/free software for you ? give same back to community .. thanks in advance! > > >> >> >> Regards, >> >> -- >> Adrien Prokopowicz >> >> >> >> -- >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> ___ >> Gambas-user mailing list >> Gambas-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/gambas-user >> > > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas Playground
2017-07-18 22:38 GMT-04:00 Adrien Prokopowicz: > I'm not sure I can understand you correctly, but I'll try my best. :) > yes your are right, sorry for my english > > If by "other gambas things" you mean "full projects", then yes, the > playground > is only intended to run Gambas scripts, since it is designed for quick > tests and prototyping, and sharing/running code on Gambas mailing-lists and > forums. > But since Gambas scripts are no different from a regular project (except > that > every class/module is in a single file), I don't see how it is a problem. > its not a problem, its only to clarify, and its make sense due GUI are difficult to "lauch" from web.. > > And for the code, I just pushed it to a GitLab repository. You'll find it > here : > https://gitlab.com/prokopyl/gambas-playground good made, better than the old-comlex svn.. thanks > > > Regards, > > -- > Adrien Prokopowicz > > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user