| 1.How to pass the argument through commandline? |
Kindly follow the below given steps to pass argument through commandline:
1.Create a new folder
2.Copy and paste the GoDBConsole.exe file in the
new folder.
3.Open sample application and use the same code
which you have mentioned above.
4.Compile and run the application in the console
platform.
5.Copy and paste the sample.bdb in the new
folder already created.
6.Goto the command prompt
7.Change directory to the new folder and then
run the following command.
godbconsole.exe sample.bdb "Arguments"
8.Then it prints the above command with
arguments in the next line.
9.Getosvar("*CMDLINE") function returns the
command Line Parameters passed to the GoDB VM. |
| Top |
| 2.Is there any option to pass data from one GoDB application to another GoDB application in PC? |
| Yes,using send message function to send messages from one GoDB application to another application through the Sock_Server Listener. |
| Top |
| 3.How to solve the round-off Issue? |
Problem: When we round off the float value using format$() function it return value have the floating point issue.
Example:
pprint format$("10.1",1.75) ''Return 1.8
pprint format$("10.1",1.075) ''Return 1.07
In the above example the first pprint we are round 2 decimal points of 1.75 value using format$() function return 1.8 correct value, but the same format$() function is used to round off 2 decimal points of 1.075 return 1.07 wrong values , correct value is 1.08 . This is sample .01 floating point issue .
Work-Around:
When we are getting Floating issue, Please Use the following function behalf of use format$() function . It return the correct values.
Function Call
pprint FormatCurrency$("10.1",1.075) ''Return 1.08
Function Definition
functionS FormatCurrency$(DimF Val)
FormatCurrency$=format$("10.2",ROUND((val*1000)/10)/100)
end function
Note: This is not an VM Issue because we tried the same thing in C++ the same result we are getting .
|
| Top |
| 4.When we pass the sub-routine arguments as parameter to CallLibFuncPas( ) function it return error. |
Problem:
When we pass the sub-routine arguments as parameter to CallLibFuncPas( ) function it return error.
Example:
Function Call:
call setposition(200,200,100,100)
Function Definition:
sub setposition(width,height,xx,yy)
dimi hwnd,h,flag,hwndA
if GETOSVAR$("*PLATFORM")="PPC" then
h=loadlib("coredll.dll")
else
h=loadlib("user32.dll")
endif
hwnd=atol(getosvar$("*hwnd"))
flag=64
hwndA = -2
CallLibFuncPas (h,"SetWindowPos",hwnd,hwndA,xx,yy,width,height,flag)
unloadlib(h)
setosvar("*setwindowstyle", "268435456")
End Sub
In the above example ,call sub-rountine “sub setposition(width,height,xx,yy)” pass integer parameters (In sub-routine assign the parameters to CallLibFuncPas() function call) it return “string values “ expected Error.
Work-Around:
Suggestion 1:
Function Call:
call setposition(200,200,100,100)
Function Definition:
sub setposition(int width,int height,int xx,int yy)
dimi hwnd,h,flag,hwndA
if GETOSVAR$("*PLATFORM")="PPC" then
h=loadlib("coredll.dll")
else
h=loadlib("user32.dll")
endif
hwnd=atol(getosvar$("*hwnd"))
flag=64
hwndA = -2
CallLibFuncPas(h,"SetWindowPos",hwnd,hwndA,xx,yy,width,height,flag)
unloadlib(h)
setosvar("*setwindowstyle", "268435456")
End Sub
In the function definition “setposition(int width,int height,int xx,int yy)” parameters define with data type . Its working fine.
Suggestion 2:
Define option() function pass the parameter value 1 in the page.
Better Work-Around solution use Suggestion 1 because some of the time we do not want to use option() [Suggestion 2 ].
|
| Top |
| 5.How to customize the content of the ''About'' option present in the default menu? |
Below is the source code to customize the ''About'' option of default menu(F1).
setosvar("*gl_7","Test Version 1.0")
setosvar("*gl_8","Test (P) Ltd")
setosvar("*gl_9",http://www.test.in)
|
| Top |
| 6.What are the functions used to create journal files? |
Following automated functions are used to create the journal files.
Functions Shortcut Keys
Jload CTRL+SHIFT+L
Jplay CTRL+SHIFT+P
Jrec CTRL+SHIFT+R
JSave CTRL+SHIFT+S
Jstop CTRL+SHIFT+R
|
| Top |
| 7.If an image by the name of c331.jpg to override GoDB default standard icon number 31. Is it possible to specify a transcol for that icon? How is that possible in a custom image using to replace a standard icon? |
Black (0) is considered to be Transparent in these ICONS. In case you need Black color in you images please use 1 as your color. Images can be embedded in Standard GoDB Strings for Rendering. To Embed image in strings you need to use \x1f{Image Name}Sequence in standard strings.
For more detials kindly refer GoDB help
GoDB Help ----> Content ----> Gbasic reference ----> Styles \ change icon |
| Top |
| 8.What is the use of calcval function? |
| This function is used to display a calculator from gbasic. |
| Top |
| 9.What is the use of ATOL? |
| It is used to convert a string to an integer. |
| Top |
| 10.Which function is used to do image animation? |
Dynamic animation is when the sprites change during animation. This can be acheived using
the Tiled Capture mode in GetImage and using the SpriteIndex (Parameter in the PutImage) |
| Top |
| 11.What dose the cache attribute in the Image control do ? |
| This attribute determines if the image is loaded to the memory or it is drawn from the underlying image file every time it is painted. |
| Top |
| 12.Where is the CLS command used? |
| This command is used in GoDB Console Version Only to clear the console screen. |
| Top |
| 13.What is the purpose of the crashing function? |
| This function Checks if two sprites are overlapping (Collision Detection). |
| Top |
| 14.Does GoDB has any function to find the x and y position of current form during Run time? |
Yes,with the help of getmousex() and getmousey() GoDB can find the x and y position of a form during runtime.
|
| Top |
| 15.How to get the ASCII number of the key pressed in run time? |
| With the help of getkey() written in form_keypress script wizard returns the ascii key of the key pressed. |
| Top |
| 16.What is the use of *OpenDOC function? |
| This function allows to open a file with the default registered app.This function also used to open video,audio document files etc. |
| Top |
| 17.What is the use of *CONNECTNET? |
| It is used to Start the network connection on th device and waits till connected (Starts the GPRS connection). |
| Top |
| 18.What is the default maximum number of characters does a text box accept?Is there any option to go increase this number? |
| 255 is the default Maximum number of characters a text box control can accept. To increase this default number select the control go to properties-->Max lenght and give the number as per the requirement here. |
| Top |
| 19.What is the comment character in GoDB? |
| For single line we can eiher use '' or Rem for multi line use /* */. |
| Top |
| 20.How to capture and display the image using X and Y region? |
| GetImage and PutImage function is used to capture and display the images. |
| Top |
| 21.What is the use of GetImageSize function? |
| The GetImageSize function is used to calculate the width and Height of the image without painting the image first. |
| Top |
| 22.What is the use of ATOF? |
| It is used to convert a string to a floating point number. |
| Top |
| 23.What is the use of Checkdated function? |
| This function checks to see if the date is valid. |
| Top |
| 24.How does dll replace GoDB Encryption? |
| GoDB Supports loading of External Component for custom Encryption Schemes. This component should be developed as a Loadable Module and named as gEncDLL.DLL and should be in the EXE directory or the System Directory.Then using loadlib dll can be loaded and using calllib the function used in teh dll can be called to encrypt and decrypt. |
| Top |
| 25.What is the use of the GBError$() ? |
This GBError function returns the GBasic Error String that was generated. This function can be used in the Error Handler page to determine the error.
|
| Top |
| 26.How to load the custom keyboard? |
GoDB Supports loadable keyboards. To create a loadable keyboard create an image of the keyboard that must to be shown and an XML file which has the image map that corresponds to the image position and char codes.
GoDB by default loads KB_MAIN.bin and KB_MAIN.xml on startup. |
| Top |
| 27.Is there any other option to close the modal frame without clicking the cross symbol in the Modal frame? |
| The Modal frame can be dismissed by hiding the frame using the hide command or by pressing the ESC key. When the user presses the ESC Key or clicks on the X Button on the top right of the frame ,cancel event is generated and Frame_Cancel Sub handler is called. |
| Top |
| 28.How can I check the unique identification of the system using GoDB? |
| Getosvar$("*HDDSLNO"), which will give you the exact and unique Hard Disk Serial Number of your computer.The Harddisk Serial number is always unique. |
| Top |
| 29.Can we use the custom images in the frame tab? |
| You can create Custom images and use them for the Tabs by using the PaneImage Property. You need to Get the image into a bitmap variable using GetImage Function and then assign the Bitmap Variable to the Paneimage property. |
| Top |
| 30.Is there any function to move an image in the runtime? |
| Using mousemove in the form load event this can be done. |
| Top |
| 31.How does GoDB support communicating using Sockets? |
| GoDB has support for communicating using sockets, Serial Ports etc. Devopen DevRead DevWrite and DevClose functions can be used for this. |
| Top |
| 32.What is the use of split function? |
| This function lets you split strings based on a separator character. |
| Top |
| 33.What is the use of curow and selrow attributes in egrid? |
CURROW-This method allows setting or getting of current selected row.If the User Clicks on the Header or on a row greater than the number of rows the selected row does not change.This attribute returns a valid value in the onchange event .
SELROW-This method allows setting or getting of selected rows.
If the User Clicks on the Header this returns -1. if the user clicks on a row greater than the number of rows in the grid then this property returns -2.A valid value is available only when the user clicks on the cell so this cannot be used in the onchange event.
|
| Top |
| 34.How to launch a WAP Browser with a URL? |
Using Setosvar WAP Browser with a URL can be done.
Ex:
SetOsVar("*LAUNCHURL", "http://www.yahoo.com") |
| Top |
| 35.How to turn off the cursor in the GoDB form at runtime? |
ShowCursor function is used to turn off the blinking focus rectangles (cursor)
Example:
ret = ShowCursor(0) |
| Top |
| 36.What is the use of LOADAPP function? |
| LOADAPP function allows to load another BDB into the current session. |
| Top |
| 37.What are the comment line commands used in the GoDB? |
There are three comment line used in the GoDB.
1.REM function
Example:
REM ***** Start of the program
2. Single quotes ('')
Example:
'' ***** Start of the program
3. /* */
Example:
/*
DIM ST$
ST$="testing"
*/ |
| Top |
| 38.What is the use of CONCAT function? |
This function is used to concatenate two strings which is useful when the destination string is large. Although g$=g$+"test" can be used, it is not efficient as the target string is reallocated every time. CONCAT function does not reallocate the target string making it more efficient and faster.
Example:
dim f$(2000)
f$= "faster"
Concat(f$,"efficient")
print f$ ''prints faster efficient |
| Top |
| 39.What is the use of SetFormRes() function? |
This function helps to fit forms designed for one platform scale to another platform. The parameters of the form specify the resolution for which the form was designed.
Syntax:
SetFormRes(FormW,FormH)
FormW - XRes of the form.
FormH - YRes of the form. |
| Top |
| 40.Is there any option to handle the Gbasic errors separately? |
SetErrHandler command is used to set the page that will handle the Errors in GBasic Applications.
In the ErrorHandler Page one can use GBError$() or GBErrNo() to determine the error that has occurred in the application.
GBError$ - Returns the GBasic Error String
GBErrNo - Returns the GBasic Error Number.
Example:
SetErrHandler("Err.Frm") |
| Top |
| 41.How style sheet is used in the GODB? |
GoDB Style sheets are text files that lets the developers change the color scheme of the entire application without
changing the color scheme in each field.
The styles are loaded in the following order.
1) Default colors in GoDB is used by default .
2) If global.css file is present then the defaults are replaced with the values in the global.css
3) If a css file is present with the same name as a Form for example if you are loading ADDCOMP.FRM and ADDCOMP.CSS is also present colour scheme of .CSS file will be applied to .FRM file.
4) If color attributes are specified for individual fields then that is used for particular field
The CSS file should be a plain text file of the format. |
| Top |
| 42.What is the use of the Syncstatus function? |
The SYNCSTATUS function returns the sync status string, this should be called after the SYNC call to determine the status and error information of a sync.
Example:
SYNC(0,3)
print SyncStatus$()
end |
| Top |
| 43.Dose GoDB support recursion? |
GoDB supports recursion only in Subroutines and not in functions.
Example:
Call recsub(1)
End
sub recsub(a)
iff a >10 then return
print a
call recsub(a+1)
endsub |
| Top |
| 44.What is Dereferencing? |
In GoDB there are two types of Dereferencing
1. Variable Dereferencing – Use to execute some functionality based on conditions.
2. Field dereferencing – Use to change field properties at runtime. |
| Top |
| 45.What are the Dimensions used in GoDB? |
GoDB Supports creation of Numeric or string arrays using the DIM statement.
DIMI – Integer Variables
DIMF - Floating Point Variables
DIMS - String Variables |
| Top |
| 46.What are the variable scope used in GoDB? |
There are three variable scopes in GoDB namely
1.GLOBAL
2.LOCAL
3.PAGE |
| Top |
| 47.What is the use of Update function? |
| The update function is used to update the text browser after the absolute positions of the objects are changed in script. |
| Top |
| 48.What are the trim functions in GoDB? |
Removes Leading or Trailing spaces from strings.
LTRIM$([EXP]) - Left Trim.
This function is used to eliminate spaces on the Left of the string.
RTRIM$([EXP]) - Right Trim.
This function is used to eliminate spaces on the Right of the string.
TRIM$([EXP]) - All Trim.
This function is used to eliminate spaces on the Left and Right of the string.
where [EXP] should be a string expression |
| Top |
| 49.How to use scroll bar from a phone? |
The SetScrlval and GetScrlval function is used to set the scroll value in mobile device. After setting the SetScrlval and GetScrlva function, you can move the page up and down in mobile device with use of joystick.
GetScrlVal(XVariable,YVariable,MaxXVariable,MaxYVariable)
SetScrlVal(XVariable,YVariable,MaxXVariable,MaxYVariable)
|
| Top |
| 50. How to put a same image on all forms? |
| First the image which needs to be displayed in all forms is insert into Form like "Header.frm". When include the "Header.frm" in source of all forms by using " #include "Header.frm" ", it will reflect to all included forms. |
| Top |
| 51.How to remove scroll bar from the form? |
In GoDB, Showscroll function determines if the scrollbar have to be shown or not. When set Scrollbars is ''0'', the auto scroll of focused field is disabled. (i.e) ShowScroll(0)
ShowScroll(Value) 0 - No Scrollbar will be displayed. |
| Top |
| 52.How to set the Auto Increment for fields of the table in GoDB? |
| The field which is need to have an auto increment value is created with number data type and also declared as Primary Key.If the field declared as primary Key in database, it will increment automatically. |
| Top |
| 53.What is the use of ATAN function? |
This function retuns the arc tangent of the number.
Syntax:
ATan([EXP])
where [EXP] is a numeric expression Which Is Angle in Radians.
Radians = (Degrees * Pi/180)
Pi= 3.141....
Example:
print ftoa$(atan(45*3.14/180) ) |
| Top |
| 54.How to get the current working directory path? |
Use the below method to retrieve the file from the image folder of current working directory.
a. #image1.src$="@..\\Image\\Test.jpg"
This gives the current working directory ..\\- exactly retrieves the directory
b. It will open the file from the current working directory
h1 = Fopen("..\\FileFolder\\Test.txt",1,1)
If h1 <> -1 Then
FileListSize = FSIZE(h1)
ret = FCLOSE(h1)
msgbox FileListSize
else
msgbox "File Not Opened"
End If
|
| Top |
| 55.How to validate the controls? |
The validate attribute allows to specify the validations for the control. The validate rules and numbers are as follows:
0- None
1- IsNotEmpty - will not allow the submit to happen if the field is empty
2- IsNumeric - will allow only numeric chars into the control.
Note: The above validations can be used in combination by adding the numbers. For example Numeric with Not Empty would be 2+1 = 3.These rules are executed only on clicking the submit button.
|
| Top |
| 56.How to get the working platform? |
Working platform can be obtained using getosvar function.
getosvar$("*PLATFORM") |
| Top |
| 57.What is difference between function and subroutine? |
Function should return the value.
Subroutine should not return the value. |
| Top |
| 58.How can I set the transparent image in GoDB? |
| For getting the transparent image to set the image attribute cache as 2 and alpha as 100. |
| Top |
| 59.How to set the auto increment field in GoDB internal database? |
If you declare a column of a table to be INTEGER PRIMARY KEY, then whenever you insert a NULL into that column of the table, the NULL is automatically converted into an integer which is greater than the largest value of that column of all other rows in the table, or 1 if the table is empty.
Example:
DB_EXEC("CREATE TABLE test(id INTEGER PRIMARY
KEY, name INTEGER)",0) |
| Top |
| 60.What is the use of #include Preprocessor? |
| GoDB supports the usage of #include Preprocessor statement in the Bas File. This Preprocessor is used to call the common bas file to all other bas file in the entire project. |
| Top |
| 61.How will you use the external images in GoDB? |
GoDB allows to call the external image from its origin itself using @ symbol and full file path.
Example:
#IMG1.SRC$="@c:/GoDB/tmp/abc.png"
(or)
#IMG1.SRC$="@c:\\GoDB\\tmp\\abc.png" |
| Top |
| 62.How to set the form resolution of the screen in GoDB? |
The setformres function helps to fit the forms designed for one platform scale to another platform. The parameters of the form specify the resolution for which the form was designed.
Syntax:
SetFormRes(FormW,FormH)
FormW - XRes of the form.
FormH - YRes of the form.
|
| Top |
| 63.What is the use of Settimer function in GoDB? |
GoDB has a built in timer for handing background tasks. The timer can be set with a time interval and an event handler function.
Example:
settimer(50,"TimerFunc")
end
Sub TimerFunc
#text1$=format$("time",Time())
#text1.paint(1)
End Sub |
| Top |
| 64.How to findout the userid of the current login user? |
The GETUSRID$() function returns the userid of the current loggedin user.
Note: When the user is not logged in, it returns - "guest". |
| Top |
| 65.How to fire the click event in the Image control? |
| Click Events will not fire if the FOCUSSABLE attribute is 0, which is the default value. So change the FOCUSSABLE attribute value as 1. |
| Top |
| 66.Can GoDB Play video clip if yes, how and which formats are supported? |
You can play video clips using GDO control. *.MPEG, *.Mpg, *.avi, *.wmv, *.mp3, *.wav file formats are supported by GoDB.
You can also use os_exec function to play the video file.
For Eg:
PRINT os_exec("C:/Program Files/Windows Media Player/mplayer2.exe c:/goal.mpeg") |
| Top |
| 67.What is the use of #ifdef? |
#ifdef is used to compile and run the code in particular platform.
For Eg:
#ifdef _PPC
MsgBox("PPC")
#endif
The above code will display the msgbox in PPC platform and not in other platforms. |
| Top |
| 68.When i try to insert a record, it is updating an existing record, why? |
This will happen if your table contains both Primary key and identy field, to avoid this remove the auto increment field (identity field) in sql server or check mannually for the record existence.
|
| Top |
| 69.OnClick of Image is Not working, why? |
| If you want to handle OnClick of an image, then you have to set the attribut "FOCUSSABLE = 1". |
| Top |
| 70.Can i include files which have common coding that effect all gbasic files? |
1) Yes, you can include files.
2) Following is the syntex to include files in gbasic #INCLUDE "functions.bas" .
|
| Top |
| 71.I am getting unsupported functions while using ATOL and ATOF function ? |
Enclose the ATOL/ATOF function with Brackets this
will solve the problem.
msgbox (atol(trim$(#PosName.tag$)))
|
| Top |
| 72.Can i use javascript in GoDB? |
| No, you cannot use javascript in GoDB. |
| Top |
| 73.What kind of application can be developed using Godb? |
1) Sales
2) Production
3) Logistics
4) Vertical |
| Top |
| 74.Is there any Restrictions of using many number of Include files? |
| No, There is no limitations for include, you can include as many file as needed. |
| Top |
| 75.What is gbasic? |
GBasic is an adaptation of the BASIC language to the Mobile Platform with An event driven model and Database extensions. The Basic language structure is Consists of a sequence of commands that are of the format
[LABEL] [LANG_KEYWORD/VARIABLE] [=] [EXPRESSION/PARAMETERS] |
| Top |
| 76.Should I have to use various coding for various OS? |
| No you dont have to, VMs are available for various platforms including windows, linux, Palm OS, Pocket PC and symbian.However look and feel issues may need changes, business logic will remain the same |
| Top |