Hi,
I am a new user of Basic4PPC. I tried the following code to get ownerinfo based on a code sample. Upon compiling I get nothing. Obviously, I am doing something wrong here.
Here is the code:
Sub Globals
Dim buff(0) As Byte
End Sub
Sub App_Start
Reg.New1 'Registry object is named 'reg'
Form1.Show
End Sub
Sub Button1_Click
If CPPC = false Then Return 'this is not for the desktop
Dim m
Reg.RootKey(Reg.rtCurrentUser)
buff() =Reg.GetValue("ControlPanel\Owner\","Owner")
For i = 0 To ArrayLen(buff()) -1 Step 2
If buff(i)=0 Then Exit 'Chr(0) separates the name from other owner entries
m = m & Chr(buff(i))
Next
Return m
Msgbox ("Owner name ",m)
TextBox1.Text= m
End Sub
Sub Button2_Click
AppClose
End Sub
I would appreciate the corrections of the code.
Amit Kshetarpal
I am a new user of Basic4PPC. I tried the following code to get ownerinfo based on a code sample. Upon compiling I get nothing. Obviously, I am doing something wrong here.
Here is the code:
Sub Globals
Dim buff(0) As Byte
End Sub
Sub App_Start
Reg.New1 'Registry object is named 'reg'
Form1.Show
End Sub
Sub Button1_Click
If CPPC = false Then Return 'this is not for the desktop
Dim m
Reg.RootKey(Reg.rtCurrentUser)
buff() =Reg.GetValue("ControlPanel\Owner\","Owner")
For i = 0 To ArrayLen(buff()) -1 Step 2
If buff(i)=0 Then Exit 'Chr(0) separates the name from other owner entries
m = m & Chr(buff(i))
Next
Return m
Msgbox ("Owner name ",m)
TextBox1.Text= m
End Sub
Sub Button2_Click
AppClose
End Sub
I would appreciate the corrections of the code.
Amit Kshetarpal