Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

I am not able to translate a simple program

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-13-2007, 12:46 AM
Newbie
 
Join Date: Dec 2007
Posts: 2
Default I am not able to translate a simple program



Can help me to translate this simple program write in qbasic ,to basic4ppc to work in smartphone ?
There is a big speak of smarthone compatibility of version 5.80 of basic4ppc ,but I have seen
any simple example of source code . I am in difficulty because as we read in main help of basic4ppc
"The following controls are not supported for smartphone :
· Button· Calendar· ImageButton· ListBox· NumUpDown· SaveDialog
The following external controls (available in the ControlsEx library) are not supported:
· ContextMenu· TabControl· ToolBar· TrackBar
· TreeView with checkboxes is not supported (TreeView without checkboxes is supported)."
The very simple program is:

--------------------------------------------------------
DIM A(2,4) // IT CREATES AN ARRAY 2X4
DIM B(2,4) // THE SAME FOR B()

DATA 1,2,3,4 // MY DATA IS DIFFERENT ,IS AN EXAMPLE!
DATA 5,6,7,8 // MY DATA

FOR K = 1 TO 2 // FILL THE ARRAY "A" WITH 1,2,3,4
// 5,6,7,8
FOR J = 1 TO 4

READ A(K,J)
NEXT J
NEXT K

CONT = 0 // THE COUNTER = 0

START:
CONT = CONT +1 // IT INCREASE THE COUNTER
IF CONT = 5 THEN END // WHEN THE ARRAY IS FULL THE PROGRAM STOP

INPUT NUMBER // THE USER INSERT A RANDOM NUMBER

FOR K = 1 TO 2
B(K,CONT) = NUMBER XOR NOT A(K,CONT) XOR NOT 1

/* BOLEAN XNOR OF THE RANDOM NUMBER WITH THE FIRST COLUMN OF ARRAY "A" ; "XOR NOT 1 " IS INSERT TO CORRECT THE RESULT ;
THE RESULT GO TO THE CORRESPONDENT LOCATION OF ARRAY "B" */

NEXT K



CLS

PRINT B(1, CONT) ; B(2,CONT)
//DISPLAY THE RESULT COLUMN OF "B"

GOTO START

/*HERE I WANT A "GOTO START" INSTEAD OF FOR-NEXT LOOP BECAUSE IN THE REAL PROGRAMM THERE IS MORE CODE THAT I HAVE NOT INSERT HERE IN THIS EXAMPLE , ... START AGAIN TO INSERT A NEW RANDOM NUMBER BY THE USER ,UNTIL THE PROGRAM STOP */

--------------------------------------------------------------
I ALSO CAN PAY IF SOMEONE CAN HELP ME
excuse me for the english , I am italian !
Reply With Quote
  #2 (permalink)  
Old 12-13-2007, 04:48 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,730
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

The unsupported controls are not supported by the Smartphone OS (not Basic4ppc).

I've attached a translation of your code.
Note that arrays begin from 0 and not 1 in Basic4ppc.
This is the code:
Code:
Sub Globals
    
'Declare the global variables here.
    Dim a(2,4),b(2,4),data(8)
    cont = -
1
End Sub

Sub App_Start
    Form1.Show
    data() = StrSplit(
"1,2,3,4,5,6,7,8",",")
    i = 
0
    
For k = 0 To 1
        
For j = 0 To 3
            a(k,j) = data(i)
            i=i+
1
        
Next
    
Next
    
bit.New1
    txtInput.Focus
End Sub

Sub mnuGo_Click
    cont = cont + 
1
    
If cont = 4 Then
        txtInput.Enabled = 
false
        mnuGo.Enabled = 
false
        
Return
    
End If
    
For k = 0 To 1
        b(k,cont) = 
bit.XOR(bit.XOR(txtInput.Text,bit.Complement(a(k,cont))),bit.Complement(1))
    
Next
    txtOutput.Text = b(
0,cont) & " , " & b(1,cont)
End Sub

Sub mnuQuit_Click
    AppClose
End Sub
Attached Files
File Type: zip Example.zip (3.0 KB, 17 views)
Reply With Quote
  #3 (permalink)  
Old 12-13-2007, 06:34 PM
Newbie
 
Join Date: Dec 2007
Posts: 2
Default thank you Erel

Thanks Erel , Now I Test The Code With My Additions
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
simple chm reader Cableguy Chit Chat 5 05-19-2008 03:40 PM
Simple Calculator RandomCoder Share Your Creations 8 11-01-2007 11:09 PM
Simple RPN - Calculator token Share Your Creations 4 10-08-2007 12:40 PM
Simple Programs to help in the gym XerVision Share Your Creations 2 07-27-2007 05:39 AM
Simple Question Scubaticus Questions (Windows Mobile) 4 07-24-2007 05:15 AM


All times are GMT. The time now is 06:07 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0