JUST BASIC MANUAL PDF

adminComment(0)
    Contents:

It is intended for educators and assumes that Just Basic is already installed on the computer. Most of this work is a summary of the tutorial to be found in the help . Just BASIC is a programming language for Windows. Create standalone Windows programs royalty free; Full tutorial and many example programs; Large . Programming: Just Basic Tutorials - Ebook download as PDF File .pdf), Text File .txt) Simple Programming with Just Basic Basic Instructions Just BASIC is a.


Just Basic Manual Pdf

Author:DORENE EISLER
Language:English, Arabic, Portuguese
Country:Haiti
Genre:Children & Youth
Pages:732
Published (Last):15.10.2015
ISBN:308-7-21831-367-3
ePub File Size:29.75 MB
PDF File Size:9.38 MB
Distribution:Free* [*Registration Required]
Downloads:23064
Uploaded by: BETHEL

This manual describes the OASIS BASIC programming language interpreter/ re-entered to correct spelling or syntax errors, just modified to the correct form. ICTL for secondary school - just basic V module. 1. MODULE 1. INTRODUCTION TO instructions into code that the computer can understand and execute. Just BASIC free download. the help of a full tutorial and many example programs contained in this software package. aSkysoft PDF to HTML Converter .

It uses and creates programs for the. They also have an incomplete at the time I write this review "Getting Started" guide that is written for the newcomer to programming. It's incomplete in the sense that they haven't finished writing it — there are whole sections that are just placeholders.

But the portions that are currently ready look promising. For those of you who are born after that period, those were BASIC interpreters that came with or ran on computers from the s or thereabouts. It emulates the most common hardware video, audio, DOS disk drives, cassette tapes, serial and parallel ports, etc at the time, can read and write binary data files created by the original GW-BASIC, and is able to run plain text, tokenised and protected.

BAS files. The compiler comes with its own IDE, although you can of course use some other editor if you prefer. It supports the addition of DLLs called modules here that provide additional functionality, such as the Crypto module which adds cryptographic functions which you can call from your application, the SMTP, FTP, TCP modules which Internet-enables your applications, sound-playing modules, and so on.

The archiver combines all the files in your project into a single executable file. Although not intended to be a Visual Basic clone , it has a visual rapid application development interface like VB.

Mono's VisualBasic. NET Development Framework. It includes a VB compiler VB.

No quotation marks are allowed in between the starting and ending quotation marks. Hello World. A string can have zero characters. Here is an example that prints a string literal in the mainwin.

In the case of a CRLF as described here. The following code inserts a carriage return. To cause a double quotation mark to print. A combination of carriage return and line feed causes text printed after it to display on the next line down. It is also possible to use the semi-colon. If the starting parameter is included. If string2 occurs more than once in string1.

This function returns the position of string2 within string1. This function returns a one character long string. This function returns the length in characters of string.

If number is 0. If number is zero or less. If number is greater than or equal to the number of characters in string. If string is "hello there". This function returns a sequence of characters from the right hand side of string using number to determine how many characters to return.

This function permits the extraction of a sequence of characters from string starting at index. If number is not specified. Earth And: If number is specified. This function returns a copy of the contents of string. This can be useful for cleaning up data entry among other things. It is useful when producing formatted output to a file or printer. By default. The next time data is displayed.

It is also possible to write rudimentary text mode programs. Here is a simple example: What's your name? To prevent the cursor from moving immediately to the next line.

This prevents the cursor from being moved down a line when the expressions are displayed. Here is how to set 40 columns and 20 rows: In the simple form input limit.

If it is necessary to obtain input without a prompt and without a question mark.

Please enter the upper limit? Commas contained within quotation marks do not signal new columns. Here is a short demo: These coordinates refer to the column and row of text. Anything printed to a text window is displayed exactly as sent. To distinguish commands sent to a text window from text that is to be diplayed in the window. It is also possible to omit the word "print" and to omit the comma after the handle when printing to a text window or texteditor.

They are used to force carriage returns when printing text. Understanding Syntax. This means that the word "print" and the comma following the handle are optional. Using variables in text commands: Literal values are placed inside the quotation marks: When printing text. The semicolon at the end of a printed command is now optional.

BAT" for text as aetext open "C: BAT" for input as autoexec print aetext. This command clears the text window of all text.

This command has two forms as described above. This second form is useful for reading large text files quickly into the window. Here is an example of the second form: Here are the text window commands: Most of the commands listed below work with windows of type "text" and also with the "texteditor" control except where noted. After this command is issued. This command returns a string either "true" or "false" that indicates whether any data in the text window has been modified.

This command sets the font of the text window to the specified name and size. Returns the text at line n. In the code above. If an exact match cannot be found. For more on specifying fonts read How to Specify Fonts print handle. This is useful for checking to see whether to save the contents of the window before closing it.

If n is less than 1 or greater than the number of lines the text window contains. This command returns the number of lines in the text window. This command returns the entire text of the window. This command tells Just BASIC to continue execution of the program at branchLabel if the user double clicks on the system menu box or pulls down the system menu and selects "close.

This command causes the current text window origin to be returned. This causes Windows to give input focus to this control. This means that. This command forces the origin of the window to be row and column.

The origin is the upper left corner of the texteditor or textwindow. This causes everything in the text window to be selected highlighted. Row and column must be literal numbers. This means that the row and column specified will appear in the upper left corner of the texteditor or text window.

To use variables for these values. When a text window is first opened. This command returns the highlighted text from the window. The result is contained in the variables rowVar and columnVar.

Graphics Previous Top Next See also: The segments which have been closed will be used to redraw the drawn graphics when the window needs to be repainted. The pen moves. Here is an example of a graphics window: The color that covers the control may be set. Drawn Text Graphics commands include the ability to place text on the graphics control at the location desired. Any drawing that does not exist in a closed segment will not be redrawn when the window is repainted.

The pen can be up or down. Drawing operations are queued up into the current drawing segment. Possible drawing operations include: Turtle Graphics Turtle graphics are drawn by a pen that moves about the screen from one location to another. Turtle graphics are good for drawing graphics and iterative objects. The pen defaults to the up position. There are two kinds of controls that accept drawing commands.

Drawn Objects Objects such as boxes. If the pen is up. Color and Size The size width of the drawing pen may be set. There are two ways to delete these unwanted drawing commands. The first segment ID is 1. Each segment has a number. The number of the currently active segment is retrieved with the segment command: If drawing segments are not deleted. This method will not clear the graphics. CLS The simplest way to delete drawing commands is to issue the CLS command before new graphics drawing commands are issued: If the graphics window is maximized after the drawing is complete.

This is similar to the. Segment and Delsegment It is possible to delete any segments that are no longer needed. When a window is closed. Here is the world's smallest painting program! In order to capture keyboard input the graphics device must have focus.

MouseY wait [letter] print w. When the leftButtonDown event happens the draw subroutine gets called. DisplayHeight draw "horizscrollbar on 0 ".

Sometimes it is necessary to force the input focus using the setfocus command: When the leftButtonDown event happens the program branches to the [draw] routine.

Mouse coordinates are contained in MouseX and MouseY. DisplayWidth draw "down". When the characterInput event happens the keyCheck subroutine gets called. When the characterInput event happens the program branches to the [keyCheck] routine. Just BASIC allows mutliple commands to be listed in a single command statement if they are separated by semicolons. In order to draw.

Software Review

Most of these commands work only with windows of type graphics and with the graphicbox control. When graphictext is designated by the use of the or character.

It is not advisable to place controls within them. Here is an example using a graphics window: It should be noted that graphics windows and graphicboxes are intended for drawing graphics.

The following example shows several graphics commands.

Quite BASIC Help

If there is a need for text display within a graphicbox or graphics window. See below for more information. Using variables in commands: To use literal values. It can no longer capture mouse and keyboard events. If an application continually draws raphics.

To create a green blue color for example. If the user resizes the window. This means that any keypresses will be directed to the control. To prevent this. This only works with display modes greater than colors. The cls. When a graphicbox is disabled. This storage function uses memory. Graphics commands in alphabetical order: To learn more about using sprites.

When drawing to a graphics window or graphic box. To create a violet color for example. Buttonface is the default background color currently set on a user's system.

Here is a graphical representation of the named colors: The memory that was used by the drawn segment is reclaimed by the operating system. When the window is redrawn the deleted segment will not be included in the redraw. The segment command retrieves the ID number of the current segment. See also the commands cls. The pen must be DOWN to cause graphics to be displayed. Each time a flush command is issued after one or more drawing operations.

Each time a segment is flushed. The second form specifies a pure RGB color. This command reactivates the drawing process. Each segment of drawn items has an ID number. Discard does not force an immediate redraw. The ellipse is filled with the color specified using the command backcolor see above. Zero degrees points to the right east. The control will not update its size and location until a refresh command is sent to the window.

Without these parameters the default range is set to 0 and the width of the graphics view in pixels. BAS example program. A large scrollbar range allows the graphics window to scroll a long distance.

A line will be drawn if the pen is down. When no longer needed. When turning on the scrollbar the optional parameters for min and max set the minimum and maximum scrollbar range in pixels these parameters do nothing when turning the scrollbar off.

It resides in memory. This is effective when the control is placed inside a window of type "window". If the value is "off". This assigned name can be used in later commands to manipulate the segment. If the value is "on". For more on specifying fonts read How to Specify Fonts Example: When printing a graphics window which has had the fill command applied.

The pie slice will begin at angle1. When graphics will be sent to the printer.

Programming: Just Basic Tutorials

See DUMP. Use the DUMP command to cause printing to begin immediately. No graphics will be drawn. Bitmap fonts stay at their native resolution when printing. Any items drawn since the last flush will not be redrawn either. It will scale the graphics based on the size they appear on the display monitor. Only TrueType fonts scale when printing. The size argument is optional and it not dependent upon the user's display resolution.

Segment ID numbers are useful for manipulating different parts of a drawing. Each additional in the text will cause a carriage return and line feed. It is also possible to use Windows constants to select a drawing rule as shown above. To get the segment ID of the last segment flushed. The text is located with its lower left corner at the pen position. Here are the constants that Windows defines: The default is 1.

This will affect the thickness of lines and figures plotted with most of the commands listed in this section. See Reading Mouse Events and Keystrokes. If the expression print handle. Example of turning off the leftButtonDown event handler: An event can also be the user pressing a key while the graphics window or graphicbox has the input focus see the setfocus command.

A can be positive or negative. MouseX and MouseY variables are passed into the designated subroutine. Sending "when leftButtonDown startDraw" to a graphics window or graphicbox tells the window to call the subroutine startDraw if the mouse is inside that window when the user presses the left mouse button.

These events occur when a user clicks. Controls and Events Sending print handle. It can however be reinstated at any time. The eventHandler can be a valid branch label or the name of a subroutine.

Without these parameters the default range is set to 0 and the height of the graphics view in pixels. Any other drawing commands will simply be ignored until the pen is put back down. Whenever a mouse event is trapped.

Whenever a keyboard event is trapped. The values represent the number of pixels in x and y the mouse was from the upper left corner of the graphic window display pane. This provides a really simple mechanism for controlling flow of a program which uses the graphics window. The graphicbox handle.

If keyboard input is trapped. If a program needs graphicboxes that trap keyboard events. Sprite Commands What is a Sprite? User License: Using "1" will cause the list to cycle forward.

This causes all visible sprites to be drawn on the background and it updates the display. This sets the background for sprites to be the loaded bitmap called BmpName. This adds a sprite with name SpriteName from loaded bitmap called BmpName. Using the optional "once" parameter will cause the sprite to cycle through its image list only one time. Using "-1" will cause the list to cycle backwards. This causes the named sprite to be removed from the collection of sprites. This causes the sprite called SpriteName to be shown as the image from its image list called BmpNameX.

This adds a sprite with name SpriteName from loaded bitmaps.. Sprite Commands Previous Top Next Only one graphicbox or graphics window in a program may use sprites. This causes the sprite called SpriteName to be oriented in one of the four directions: SpriteName" input w.

This causes the sprite called SpriteName to be visible if "on" is used. SpriteName x y" This obtains the coordinates of the sprite called SpriteName and places them into the variables x and y.

What is a Sprite? Previous Top Next Here is a background image: Bitmaps are rectangular images. Here is the bitmap of the frog. A program might need to put a picture of a hopping frog onto this background. Here is the picture of a frog: The frog is a bitmap also. When done with sprites. That doesn't look very convincing! It is possible to make it look like the frog is part of the picture by using sprites.

How Do Sprites Work? Previous Top Next As was explained in the previous section. Realistic graphics require a way to place the image from a bitmap onto a background without including the image's own background. The mask is directly above the sprite. There are two versions of the image. TO A mask has a white background. A mask is a black and white image.

The shape of the image is the actual mask. It is not displayed on the screen in this form: Here is a mask for the frog image: This is a single bitmap: It is possible to add a mask to the sprite image using Paint. Add a mask here. If this were to be done with an actual picture a piece paper.

The mask is placed on the background bitmap in memory. This can be done with bitmaps. The programmer does not need to deal with these operations. This cutout could then be pasted onto the background. To avoid flickering. When an entire frame of animation is built. The mask is now in place. The next layer adds the sprite. Here is an example. Only one graphicbox or graphics window in a program may use sprites. Note that simply setting the background bitmap does not cause the background image to display on the screen.

The height of the bitmap is less than the height of the graphicbox. CHM 0. See the section on Drawing and Collision Detection to find out about updating the display. If the height of the bitmap is less than the height of the graphicbox or graphics window. The width of the following bitmap is greater than the width of the graphicbox.

One way is to use a loaded bitmap as the background. The background image will be stretched to fit the given dimensions. If the width of the bitmap is less than the width of the graphicbox or graphics window. It is possible to create a graphicbox whose dimensions are much larger than the window that contains it. This command updates the display. Even if there are no sprites in use. This example uses a graphicbox whose width is and height is The example gets the bitmap from the graphicbox at 0.

To set a new bitmap called "mountains" as the background. Note that the width and height appear to be less than the width and height of the graphicbox. None of the properties of the "guy" sprite change when the image is changed.

The spritename is used to refer to this sprite when setting its properties. These names can be the same. It designates the NAME to give this sprite. Bitmaps can be used multiple times within one sprite designation.

It is possible to have several different versions of a sprite image. For each frame of animation. The versions might look like this: Now the sprite with the NAME of "frog" contains three individual frog images.

When the image moves. To show any image from the list. The bitmaps for the frog look like this: The code to load them looks like this: Note that "frog2" is used twice here: Learn about updating the display in Drawing adn Collision Detection. In this manner. A frame of animation is built entirely offscreen.

A value of "1" will cause the sprite to cycle through all images in its list from first listed to last listed. To change the size of a sprite to be one and one-half times the width and height of the loaded bitmap: A value of "-1" will cause the sprite to cycle through all of its images in the reverse order from which they were listed.

After the single cycle through frames. A value equal to one of the images in the list will cause the sprite to cycle to that image. To cycle forward through all images: Sprites have several other properties that can be set by the programmer.

This is useful for animations such as explosions. A percentage of will cause the sprite to appear twice the original width and height. It is easy to cause them to appear as a mirror image of the loaded bitmap. The following command moves the sprite named "smiley" 5 pixels in the x direction and 2 pixels in the y direction each time a new animation frame is drawn.

See the section on Drawing and Collision Detection! It is not possible to rotate 90 or degrees. Sprites can have alterations in both scale and orientation at one time. The frog sprite has touched one of the bug sprites. The second line reports that "smiley" collided with "smiler" and "smiles" during that frame of animation. This command must be given each time it is necessary to draw another frame of animation. The sprite names are returned in a single string with spaces between them.

If the background image is to be moved. The fourth line reports that "smiley" did not collide with any other sprites during that frame of animation. If this were a game. See the section on backgrounds for more information. The third line reports that "smiley" collided only with the sprite named "smiler" during that frame of animation. Knowing this. It can be followed by an input statement. If a sprite is to be out of action for a time.

Sprite graphics are temporary. Invisible sprites may be used to set up a screen area for collision detection. For instance. This might be done after a sprite collides with another sprite. To learn about making sprite graphics remain in a graphicbox or graphics window. It looks like this in a program: If the sprites are part of an animated display.

The "flush" command consumes memory. It is rarely necessary to flush animated graphics. It first requires a command to: Actually, the goto part of the if. Either of these two forms is acceptable: We can use the if.

For example, instead of checking to see if amount was equal to 0 in the above program, we could have checked to see whether it was less than 0.

We can add extra blank lines between our printed output to break things up. This is done by using an empty print statement, one for each blank line.

We can also clear the window at an appropriate time with the cls statement. Both of these techniques are applied to our tax program in the listing below: In this example, we are using an input statement to halt the program, so the instructions can be read. When [Enter] is pressed as instructed, dummyVariable receives the value of what is entered. In this case, only [Enter] is pressed, so dummyVariable gets a value of zero for its data.

It really doesn't matter what dummyVariable's data is since we don't use the variable in any calculations elsewhere hence the name dummyVariable. So far, the only kind of variables we have used are for holding number values.

There are special variables for holding words and other non-numeric character combinations. Let's look at a very simple program using strings: Once you've typed it and pressed [Enter], it responds with: It's nice to meet you, your-name-here Notice one special thing about our string variable name. This makes it a string variable. As you can see from our program example, you can both input and print with string variables, as we did earlier with our non-string or numeric variables. We've actually been using strings all along, even before this section about string variables.

This is a way to directly express a string in a BASIC program, exactly the way we type numbers directly in, only with characters instead. A string literal always starts with a quotation mark and always ends with a quotation mark.

No quotation marks are allowed in between the starting and ending quotation marks point: NOTE - A string can have zero characters. Such a string is often called an empty string. In BASIC, an empty string can be expressed in a string literal as two quotation marks without any characters between them.

Just as you can manipulate numbers in a computer programming language by adding, subtracting, multiplying, and dividing, and more! Comparing strings - We can compare strings with each other just as we can compare numbers. This means that we can use the if. When comparing strings, a string is considered to be equal to another string when all the characters in one string are exactly the same in both strings.

This means that even if they both print the same onto the screen, they can still be unequal if one has an invisible space on the end, and the other doesn't. Now that we've covered bringing data into your programs with input, displaying data with print, keeping data in string and numeric variables, and controlling program flow with if.

Functions provide a means for manipulating program data in meaningful ways. Look this short program: The len function returns the number of characters in a string. The expression inside of the parenthesis must either be a string literal, a string variable, or an expression that evaluates to be a string. This identifies len as a string function.

There are other string functions for example: The result returns is a number and can be used in any mathematical expression. There are numeric functions as well. The sin function takes the value of count enclosed in parenthesis and returns the sine a function in trigonometry, a branch of mathematics for that value. Just like the len function above, cos and other numeric functions can be used as parts of bigger expressions.

We will see how this works just a little further along. Notice also the way the program counts from 1 to Then the program prints the sine of count the sine of one, in other words.

This happens over and over until count reaches a value of 45, and then it doesn't go back to [start] again, but instead having no more lines of code to run, the program stops. Going back to execute code over again is called looping. We saw this earlier when we first used the goto statement. In our first use of goto, the program always looped back.

In this newest example program we see going back to execute code over again, but based on a condition in this case whether count is less than This is called conditional looping you guessed it, the looping that always happens is called unconditional looping, or infinite looping. When writing very short and simple BASIC programs, it isn't usually difficult to grasp how they work when reading them days or even weeks later.

When a program starts to get large then it can be much harder. Since a variable name can be as long as you like and because Run BASIC lets you use upper and lower case letters, variable names can be very meaningful. For example if you are branching to a routine that displays help then use [help] as your branch label. Or if you are branching to the end of your program you might use [endProgram] or [quit] as branch labels.

The rem short for remark statement lets you type whatever you like after it you can even misspell or type gobbledy-gook, it doesn't care! Run BASIC just skips over these lines, but a human reader finds this kind of documentation very helpful. Also see the way that blank lines were added between the different parts of the program?If the value is changed in the called subroutine or function, it does not change in the main program.

It must be replaced with the correct expression to suit the problem. As you learn to program in Just BASIC you will be able to extend this program and the other included samples to do what you want.

There is no practical limit to the length of a variable name. If you see one of these errors. This might happen when the program gives the user a notice message.

DANICA from Lincoln
Look over my other articles. I am highly influenced by laser tag. I do like reading novels quaintly.
>