vb code

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

vb code

Shane-2
I have some vb code i want to convert to gambas and it uses this code

Private Type ID3V22HDR
    frameName1 As String * 3
    frameSize1 As Byte
    frameSize2 As Byte
    frameSize3 As Byte
End Type

what would be the best way to convert this to gambas?



------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: vb code

adamnt42@gmail.com
Guessing without information about what a vb private type is and where and why you would use it , but there is a thing called a Struct in Gambas, maybe that is what you are looking for.
b

On Fri, 14 Jul 2017 17:27:44 +1000
Shane <[hidden email]> wrote:

> I have some vb code i want to convert to gambas and it uses this code
>
> Private Type ID3V22HDR
>     frameName1 As String * 3
>     frameSize1 As Byte
>     frameSize2 As Byte
>     frameSize3 As Byte
> End Type
>
> what would be the best way to convert this to gambas?
>
>
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user


--
B Bruen <[hidden email] (sort of)>

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: vb code

PICCORO McKAY Lenz
In reply to this post by Shane-2
2017-07-14 3:27 GMT-04:00 Shane <[hidden email]>:

> I have some vb code i want to convert to gambas and it uses this code
>
> Private Type ID3V22HDR
>    frameName1 As String * 3
>    frameSize1 As Byte
>    frameSize2 As Byte
>    frameSize3 As Byte
> End Type
>

the most close are a struc.. i mean.. in the (poor) visual basic u define a
"type" but really that "type" must be instanciated/redeclared before use it

so then struc maybe its the shor.. but will act as a new class to use it, i
mean, event

Dim variable as new ID3V22HDR


>
> what would be the best way to convert this to gambas?
>
>
>
> ------------------------------------------------------------
> ------------------
> 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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: vb code

Gianluigi
In reply to this post by adamnt42@gmail.com
You can take a look at this discussion [0]
Regards
Gianluigi

[0]
http://gambas.8142.n7.nabble.com/Random-access-files-with-fixed-length-string-td50880.html

2017-07-14 10:09 GMT+02:00 [hidden email] <[hidden email]>:

> Guessing without information about what a vb private type is and where and
> why you would use it , but there is a thing called a Struct in Gambas,
> maybe that is what you are looking for.
> b
>
> On Fri, 14 Jul 2017 17:27:44 +1000
> Shane <[hidden email]> wrote:
>
> > I have some vb code i want to convert to gambas and it uses this code
> >
> > Private Type ID3V22HDR
> >     frameName1 As String * 3
> >     frameSize1 As Byte
> >     frameSize2 As Byte
> >     frameSize3 As Byte
> > End Type
> >
> > what would be the best way to convert this to gambas?
> >
> >
> >
> > ------------------------------------------------------------
> ------------------
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
> --
> B Bruen <[hidden email] (sort of)>
>
> ------------------------------------------------------------
> ------------------
> 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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: vb code

zxMarce
In reply to this post by PICCORO McKAY Lenz
Actually a type in VBA (old VB6 and MSOffice Basic) is not regarded as an object, it is more akin to a C Struc.

All you do to use it is "Dim myVar As UserType". You use New for object classes only, and Type is not a class or object.

The Private clause makes the user type definition accessible only in the form, module or class where it is defined, making the type unavsilable to others.

HTH,
zxMarce.


On Jul 14, 2017, 09:36, at 09:36, PICCORO McKAY Lenz <[hidden email]> wrote:

>2017-07-14 3:27 GMT-04:00 Shane <[hidden email]>:
>
>> I have some vb code i want to convert to gambas and it uses this code
>>
>> Private Type ID3V22HDR
>>    frameName1 As String * 3
>>    frameSize1 As Byte
>>    frameSize2 As Byte
>>    frameSize3 As Byte
>> End Type
>>
>
>the most close are a struc.. i mean.. in the (poor) visual basic u
>define a
>"type" but really that "type" must be instanciated/redeclared before
>use it
>
>so then struc maybe its the shor.. but will act as a new class to use
>it, i
>mean, event
>
>Dim variable as new ID3V22HDR
>
>
>>
>> what would be the best way to convert this to gambas?
>>
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> 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
>> [hidden email]
>> 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
>[hidden email]
>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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: vb code

gambas-user mailing list
In reply to this post by Shane-2
Le 14/07/2017 à 09:27, Shane a écrit :

> I have some vb code i want to convert to gambas and it uses this code
>
> Private Type ID3V22HDR
>     frameName1 As String * 3
>     frameSize1 As Byte
>     frameSize2 As Byte
>     frameSize3 As Byte
> End Type
>
> what would be the best way to convert this to gambas?
>

Did you read that? http://gambaswiki.org/wiki/lang/structdecl

--
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user