[Gambas-user] VB to Gambas

Charlie Reinl na2492 at ...9...
Sat Feb 19 20:29:46 CET 2005


>Hey there, 
> 
>I want to convert my VisualBasic Project to Gambas. 
> 
>I use in VB following code: 
> 
>Public Type ProgType 
>    Name As String 
>    Pfad As String 
>    Verzeichnis As String 
>End Type  
>Global Prog1 as ProgType 
>Global Prog2 as ProgType 
> 
>so i can use it like: 
> 
>Prog1.Name = "Editor" 
>Prog1.Pfad = "c:\windows\editor.exe" 
>Prog1.Verzeichnis = "c:\windows\" 
>... 
>Prog2.Name = "notepad" 
>Prog2.Pfad = "c:\windows\notepad.exe" 
>Prog2.Verzeichnis = "c:\windows\" 
> 
>....an so on. 
> 
>How can i declare and handle it in gambas?? 
> 
>Thanks a lot>    Name As String 
>    Pfad As String 
 
Salut, 
 
to replace the VBusertype , create a Class  
we call it ProgType ( the file will be ProgType.class) 
and fill like that 
 
' Gambas class file 
STATIC PUBLIC Name AS String 
STATIC PUBLIC Pfad AS String 
STATIC PUBLIC Verzeichnis AS String 
 
Now in you project decleare. 
 
Global doesn't exist in gambas. See about in the list. 
 
PUBLIC Prog1 AS NEW ProgType 
PUBLIC Prog2 AS NEW ProgType 
 
Now you can use it like in your VB project. 
 
Prog1.Name = "Editor" 
Prog1.Pfad = "c:\windows\editor.exe" 
Prog1.Verzeichnis = "c:\windows\" 
....an so on. 
 
Amicalment 
Charlie 
* Gesendet mit / Sent by: FEN-Webmail * http://www.fen-net.de *




More information about the User mailing list