NS Basic/CE Enhancements March 01, 2010 © NSB Corporation. All rights reserved. |
8.2.0
Documentation Changes for Version 8.2.0
You can now compile an NS Basic program from the command line. The format is nsbasic programName -compile. The programName should be a full path. Example:
c:\program files\nsbasic\ce\nsbasic "c:\my projects\sample.nsb" -compile
8.1.1
8.1.0
Documentation Changes for Version 8.1.0
Hi Res Support: Some Windows Mobile devices have a screen size larger than 240x320. Devices with VGA screens are 480 x 640, for example. NS Basic/CE programs running on devices with different screen sizes have always looked exactly the same: the 240x320 coordinates are mapped on the VGA screen so everything is still in the same place and the screen completely filled.
However, it is possible to use the extra pixels. By setting HiRes Aware to True in Project Properties, your program will treat the screen as it actually is 480 x 640. This will let you create smaller objects and smaller text.
If you want your project to be Hi Res aware, but still run on regular devices, check output.height and output.width in your Form_Load routine. Adjust object bounds and font sizes if necessary.
Dir To Install: Lets you specify a directory to be installed with your app. In Project Properties, you can now enter in the name of a folder in the project's directory. This folder (and its contents) will be included in the installer. It will be put into the home directory of your app on the device. This is a handy feature if you have a number of files to be included with your app, such as data, sounds or images: you no longer have to specify the name of each of these files.
SendMessageString(): This function works just like SendMessage(), but allows a string as the last argument.
Fat Executables: NS Basic/CE now produces a single exe file which contains the NS Basic runtime. While it increases the size of the program by about 200k, it eliminates the installation of \Program Files\nsbasic\Basic.exe, saving the same amount. One less directory is created in \Program Files and many registry entries are eliminated. The net result is a simpler installation. Launch times should also go down.
Icons: To replace the default NS Basic icon in your app, create a .ico file and put its name into the Icon property in Project Properties. Which sizes are needed depending on what devices you are supporting. If you want to support all devices, you will need at least the following: 16x16, 21x21, 32x32, 43x43 and 64x64. A good free tool for making .ico files is IcoFX.
8.0.2
8.0.1
8.0.0
Documentation Changes for Version 8.0.0
At this time, gradient buttons are supported by Windows Mobile 5 and newer devices.
Options Installer Screen: This screen controls options for creating the installer. If you have a Windows Mobile device, you probably do not need to change them. There is more information in Tech Note 30.
Starting a program: The options on the Run menu have changed.
Start: Saves your work, creates an exe file that can run on the device, then creates an installer for it. If "Run Automatically" is set in Options, the installer is started.
Update App on Device: Use this if your app is already installed on the device and you just want to update your program's exe. If "Run Automatically" is set in Options, the app is started.
Install Device IDE: The Device IDE is install and its serial number is set. You only need to do this if you want to program on the device.
Resources: Resources are files that are associated with your project, to either be installed in the program's folder or embedded directly in your exe file. For more information on files to be installed, see Tech Note 30. Embedded files are covered next...
GetResource(Name[, [filename, register]])
This powerful function allows you to do a number of things to resources contained in your app. The resources must already exist in your app: they must first be added in the IDE as Resources of type 'File' in the Project Explorer of the IDE.
Use this function to:
Complete documentation can be found in the Language Reference. See the "Resources" sample for more info.
CreateShortcut(Shortcut name, target path)
Creates a directory shortcut to an executable. Returns true if successful, false if it cannot create the shortcut or it already exists. The target path should include quote marks, so it can be parsed properly.
Example:
'This will create a link in the Programs folder to your program. err = CreateShortcut("\Windows\Start Menu\Programs\My Test.exe", """" & currentPath & """")
NSCEPictureBox.ResourceBitmapIDstr: This property gives the name of a bitmap (.bmp) resource to be displayed in a picturebox. The .ResourceFile property must also be set with the name of the file (an exe or dll) that contains the bitmap resource. It is similar to the .ResourceBitmapID resource, which only takes a resource number. The name must be in upper case.
Example:
myPicturebox.ResourceBitmapIDstr = "GRADIENTBUTTON"See the "Resources" sample for more info.
Support for older versions of Windows CE has been dropped: The installers for NS Basic were getting unncessarily complex: Windows CE devices as far back as 1996 were being supported. NS Basic/CE 8.0 supports devices using Windows CE 4.2 and later. Pocket PC 2003 and all Windows Mobile devices with touchscreens are supported, as well as Windows Mobile Embedded devices.
Compatibility: NS Basic/CE 7 programs (and earlier) should load into NS Basic/CE 8.0 with no problem. NS Basic/CE 8.0 programs will not open in earlier versions, so keep a backup!
7.0.5
7.0.4
7.0.3
7.0.2
7.0.1
In most cases, Execute will do as you expect. If you are using it in a subroutine, any variable or subroutine you create will only be around while you are in the subroutine. If you want the variable or subroutine to stick around after your function ends, then use ExecuteGlobal.
The difference we have found with NSExecute is that AddObject statements are able create objects that send events back to your program.
7.0.0
MsgBox SpecialFolder(0h0006) 'displays \My Documents on English Pocket PC
ID values are:
6.5.3
MsgBox SpecialFolder(0h0006) 'displays \My Documents on English Pocket PC
ID values are:
6.5.2
6.5.1
6.5.0
To add a module to a project, choose either Add Module from the Project menu or right click on the project in the Project Explorer. Modules are added to your program in the order they appear in the Project Explorer. If you want to change the order in which they are compiled, right click on the project in the Project Explorer.
Internally, the modules are added to the project code in the order specificed before compilation. You can put DIM statements, subroutines, functions and code into a module. If you would like to see the actual code that will be compiled, save the project as a txt file and open it in NotePad.
Running a program with modules is the same as one without. If you choose Start under the Run menu, a .nsb file will be produced that combines your main project code with all your modules.
You can also choose Make under the File menu. In this case, a .exe file will be produced that will run on Pocket PC devices. It will be named the same way as the .nsb file is.
The Output object in has a new read-only propery: ParentHwnd. This returns the parent window of the Output window. It is useful for many system routines that require a window. The following example displays a popup menu on NSBasic CE, using the Output.ParentHwnd property.
AddObject "CommandButton", "cb1", 10, 10, 100, 20 cb1.caption = "Menu" Declare "Function CreatePopupMenu Lib ""Coredll"" () As Long" Declare "Function AppendMenu Lib ""Coredll"" Alias "AppendMenuW"" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As String) As Long" Declare "Function TrackPopupMenuEx Lib ""Coredll"" (ByBal hMenu As Long, ByVal un As Lont, ByVal n1 As Long, ByVal n2 As Long, ByVal hWnd As Long,lpTPMParams As Long) As Long" Const TPM_RETURNCMD = $H100& Const MF_ENABLED = &H0& Const MF_STRING = &H0& Const MF_GRAYED = &H1& Const MF_SEPARATOR = &H800& Sub cb1_Click Dim ret Dim hMenu hMenu = CreatePopupMenu AppendMenu hMenu, MF_ENABLED Or MF_STRING, 1, "Option 1" AppendMenu hMenu, MF_ENABLED Or MF_STRING, 2, "Option 2" AppendMenu hMenu, MF_ENABLED Or MF_STRING, 3, "Option 3" AppendMenu hMenu, MF_GRAYED Or MF_SEPARATOR, 4, "" AppendMenu hMenu, MF_ENABLED Or MF_STRING, 5, "Fuhgettaboutit" ret = ShowPopupMenu(0, 0) MsgBox ret End SubYou must use the ParentHWnd property because under Windows Mobile 5, attempting to display a popup menu using Output.Hwnd causes undesirable results. This appears to be unique to Mobile 5 and does not occur on earlier devices.
You can also present popup windows under NSBasic Desktop by using the Output.Hwnd property, provided that the appropriate core DLL is installed on the system.
If you are writing code that is to run under both NSBasic CE and NSBasic Desktop, you can take advantage of the fact that Output.ParentHwnd is always 0 under NSBasic Desktop.
6.1.0
6.0.4
Note that EXE files are only produced for ARM devices, primarily Pocket PC. This includes Windows Mobile 5 and Pocket PC 2003. EXE files will not run on devices that use SH3 or MIPS processors. If you make an EXE file using NS Basic/CE 6.0.4, make sure your runtime is also 6.0.4.
6.0.3
AppTitle = "My Program"
6.0.2
The icon must be a valid Windows .ico file. It should have 32x32 and 16x16 icons in it. The number of bits per pixel does not seem to matter.
6.0.1
6.0.0
5.1.2
5.1.1
5.1.0
5.0.3
5.0.2
Here is a list of all the changes to NS Basic/CE 5.0.2.5.0.1
Here is a list of all the changes to NS Basic/CE 5.0.1.5.0.0
Here is a list of all the changes to NS Basic/CE 5.0.0. All new statements are documented in the Help menu in the desktop IDE.sub frmMyForm_load msgbox "fromMyForm has just been loaded" end sub
To affect the appearance of the current form, do not use Output_ If ActiveSync is used and the device has an IP address because of a LAN card, you will need to set the connection type to WAN and enter the IP address of the device. This is because VCE tries to connect to 192.168.55.101 when using ActiveSync and this address is overridden if a network device is active on the machine.
Screen images can be captured using Virtual CE using the SnapShot button. A bitmap image is saved into the file
Virtual CE is a feature that makes it easier to debug your programs on the desktop. To use it, you need to have a device connected to your desktop system via ActiveSync. Select "Start Virtual CE" from the Run menu, and an image of your device will appear on the desktop. You can operate your programs directly on the desktop: everything you do will actually run on the device, updating the screen image.
\Program Files\NSBasic\CE\Tools\RECORDED_DATA
We tried hard to make the EmCE emulator work. However, the differences between Windows on the desktop and Windows CE are too deep and substantial to make EmCE ever be an accurate emulator. Many of the Microsoft controls that EmCE depended on are implemented differently on the desktop and the device. Rather than using EmCE, we've elected to support Virtual CE, which works much better.
You can now add Frame objects to projects. Objects that are added on top of a Frame become children of that frame: hiding and showing a frame will hide and show the child objects.
All Desktop IDE messages and text are contained in the file
\Program Files\Nsbasic\CE\Lang\strTable_English.txt.
This allows the IDE to be localized into other languages by translating this text file. Let us know if you do this: we would like to include it for others who use your language.
4.0.0
Completely new Desktop IDE.
We've done a complete rewrite of the Desktop develpment environment. Starting with the codebase used in NS Basic/Palm, we've made the new version much easier to maintain and improve.Em CE - the new NS Basic CE Emulator
This is a new tool to allow you to test your programs on the desktop before downloading to the device. It can't do everything a Windows CE device can, so be sure to read the Warning section of the Readme file for more info.Support for Pocket PC 2002 Phone Edition added.
New devices using this OS have starting shipping - NS Basic/CE 4.0 can create programs to run on these devices.Desktop IDE can now create programs that execute immediately on device.
Before, you could only save your program in .txt format. You had to load the program in the device IDE and save it before it could be run. Now, the Desktop IDE produces apps that are ready to run on a Windows CE device.Desktop can now load and save .nsb files.
The old desktop could only load .txt versions of programs. The new version lets you load .nsb apps that you have created on the device.The IDE can be localized by changing the \Lang\Str_Table.
All messages in the IDE are now kept in a Table. Under Tools...Options, you can select which string table you want to use. This can be used to create localized versions of the IDE for other languages. We will be adding Japanese and German string tables in the future.Third party tools in the \Tools will appear in the menu
Now, tools from third parties can be integrated into the NS Basic desktop environment. Simply put them into the Tools folder. The next time NS Basic is started, they will automatically appear in the Tools menu.Form_Load and Form_Unload are supported.
NS Basic/CE now suppports a Form_Load subroutine that will get called when a form is loaded. The syntax isSub Form1_load() 'your code End SubPlace this code anywhere in your program and it will be executed just after the form is loaded. If you double click on the form in the CE Screen of the IDE, the load subroutine will appear.
Note that during when a form is loaded, the initial set of the value of a textbox will generate a textbox_change event. To ignore this event, put the following line of code at the beginning of the textbox_change code:
if form1(0)=false then exit sub
Once the form load processing is complete, form1(0) will have the value True.
Help greatly expanded.
We've compiled the reference section of the Handbook and put it under the Help menu. Now the full descriptions and samples for all statements, functions and commands are available right in the Desktop IDE.New shared library: NSBPhone adds telephone support.
We include a new shared library that lets you access of the unique telephony features the new Pocket PC Phone Edition devices.New serial number system implemented.
You'll need to use your new serial number to get both the desktop and device IDE working. We apologise for the inconvenience, but we had a problem with pirated numbers and people trying to hijack other user's serial numbers. Please keep your new number confidential.Problems with saving while Encrypted fixed.
On some devices, programs which were saved while encrypted could not be loaded again by the developer. This has been fixed so that only the original developer can load an encrypted program.4.0.1
Documentation Notes for 4.0.1
sub Output_close() bye end sub
4.0.2
Documentation Notes for 4.0.2
myButton.timer=100 sub myButton_timer() msgbox "myButton Timer event!" end sub
4.1.0
Support added for Mobile Windows 2003, also known as Pocket PC 2003. This has been done transparently: you do not have to make any changes to your code. The same NS Basic/CE program will run on Pocket PC 2003, Pocket PC 20002 and Pocket PC, as well as many other Windows CE devices.The new NS Basic 4.1 Runtime and Basic installers work on all these devices, installing the proper files, so your programs and NS Basic/CE will work.
4.2.0