Jey Visual Pascal V 0.5

Torna all'indice dei giochi What is JVP?
Jey Visual Pascal or JVP in short is a programming tool for easy and fast creation and programming of windows, gadgets and menus under the Amiga standard operating system libraries, i.e., exec, dos, intuition, graphics, diskfont and so on. It also provides the support for other standard or common used libraries such as ASL, ARP and so on. It is claimed that using JVP saves 50% of the programmer time. Creating gui's is done by several mouse click&drags only, and thus it should be pleasant too.
Main JVP menu'sThe main idea behind JVP is very close to other visual languages, but the way it implements the idea is a little different. Creating and handling gadgets and windows always consumes a lot of the programmer time and on the other hand a good gui is as important as the main code, no matter what it does, good look and ease of use is the must for every software from small to large. So any programming method such as JVP which let you create the gui in several minutes means that it has saved you more than 50% of the chore, and you will have to fill up the blank areas of the code which will give life to the gui.

Features
(NOTE: Some features will only be accessible in the full version.)


How to do?
Programming by JVP comprises of two parts (as other visuals), gui (or form) and the main code. JVP comes with a visual gui creater and a pascal unit (compiled for Kick/Maxon pascal) which is the main core of JVP.

There are specific steps toward programming by JVP:
In the JVP gui creator do the following:

Now your "Form" or "Gui" or ".mnu" file is ready and you should program for it. You can modify the gui later if needed. The gui file is a binary file but the pascal source is a plane text file.

Creating my first window by click&drag. Load the pascal source code generated by JVP into one of the Kick pascal or Maxon pascal compilers and then run it, you will see your window and gadgets working but do nothing! Now you should only fill up the blank spaces between "Begin" and "End"'s in the source code. All gadgets and windows are named automatically and are easy to address by human.

At this point I explain a little about the JVP pascal unit by example:

JVP Unit
Thanks to the unit idea in pascal which let programmers to share their routines in a standard and easy method.
The pascal source created by JVP gui manager uses some of the functions and procedures in the JVP unit. Using the JVP unit you can program very easily and with the least pain.
Modifying my first added gadget. JVP unit will tackle the gui operations in whole and removes the complexity of the Amiga OS commands in a pascal source code. e.g. when initialising the gui, you need not to define too many variables, pointers and records and use the os commands (i.e. intuition, diskfont, asl, ...) to setup the windows and gadgets! But you only invoke a simple command like below:

LoadGUI(filename);

This simple command and all other JVP commands are defined in the JVP unit and are accessible when using it. Let's see an example source code generated by JVP gui manager:

----- Sample Source code for JVP: -------------------------------

(***        Jey Visual Pascal       ***)
(***  $VER: Jey Visual Pascal 0.50  ***)
(*** Hossein Shirdashtzadeh 1376-77 ***)
Program JVP_Program(Input,Output);
Uses JVP;
{********* Const **********}
Const
	Menu_1{My Window}=1;
		M1_Gad_1{My Gadget}=1;
		M1_Gad_2{My Gadget2}=2;
	Menu_2{My Secound Window}=2;
		M2_Gad_1{My Gadget3}=1;
		M2_Gad_2{My Gadget4}=2;
		M2_Gad_3{My Gadget5}=3;
{*********My Secound Window***********}
Procedure Proc_Menu_2{My Secound Window};
Var
	OutReal:Real;
	OutString:String;
	Menu_ID:integer;
	Menu_Win:p_window;

Begin
	Menu_ID:=0;
	Menu_Win:=InitGui(Menu_2{My Secound Window});
	While Not (Menu_ID in [-1]) do
		Begin
		Menu_ID:=Get_Gui_ID(Menu_2{My Secound Window},0,1,OutString,OutReal);
		Case Menu_ID of
			M2_Gad_1{My Gadget3}:
				Begin
				End;
			M2_Gad_2{My Gadget4}:
				Begin
				End;
			M2_Gad_3{My Gadget5}:
				Begin
				End;
			Otherwise;
			End;{Case}
		End;
	CloseGui(Menu_2{My Secound Window});
End;
{*********My Window***********}
Var
	OutReal:Real;
	OutString:String;
	Menu_ID:integer;
	Menu_Win:p_window;
{********* Main ***********}

Begin
	Menu_ID:=0;
	LoadGui('ram:test.mnu');
	Menu_Win:=InitGui(Menu_1{My Window});
	While Not (Menu_ID in [-1]) do
		Begin
		Menu_ID:=Get_Gui_ID(Menu_1{My Window},0,1,OutString,OutReal);
		Case Menu_ID of
			M1_Gad_1{My Gadget}:
				Begin
				End;
			M1_Gad_2{My Gadget2}:
				Begin
				End;
			Otherwise;
			End;{Case}
		End;
	CloseGui(Menu_1{My Window});
End.
-----------------------------------------------------------------


We assume that "Ram:test.mnu" was created by JVP gui creator and contains the gui data. By compiling and runnig this program we see that the first window will open and only by pressing the close gadget or ESC will vannish.

After some gadgets added now modify the parameters of the 5th gadget. As it is clear from the code, after using JVP, every window and gadget has been numbered by constant values in the program header. These are done by JVP gui creator. It has designated the window and gadget names in comments too. After that, there are two procedures defined for the two windows which has been created in JVP gui creator. Each procedure is filled by some standard variables and commands. The variables are used to transfer string, real and integer values between the program and JVP gadgets. In the main routine the first JVP command is "LoadGui()" which loads a menu or gui binary file containing all JVP windows and gadgets. After that and also in all other JVP procedures, the first JVP command is "Initgui()" that will open the relevant window and return the pointer to the window structure. This pointer can be ignored by most of programmers, but experts will enjoy it. Next we see a "While" loop that consists of a control command.
Modify the parameters of my first window. This command is "Get_GUI_ID()". By this command the number of activated gadget is transfered to our program and based on the "Case" we will do our task. Each branch of the "Case" is designated by the commented name of the pertaining gadget in the window.

Finally save the pascal source of my menu's. After the "While" loop we see a "CloseGUI()" command which will close the window. But based on the mode of the gadget pressed, it will close with one of the two modes: "Cancel" (or "Unchanged") and "Return" (or "Changed"). If there are some proportional gadgets, string gadgets and toggle gadgets in the window, their state will remain unchanged if the pressed gadget is of "Cancel" type one. And the changes will remain if the pressed gadget is of "Return" type one. Note that all windows data are stored in memory and are managed by JVP automatically.

Sample software created by JVP.This is the standard format of a JVP pascal source. As you see there is no need to build records and pointers to create windows and gadgets. This lead to simpler program. Also one will know what is doing and what should do.

Other Similar Softwares
As I know and searched, there is no other software with this idea, specially for pascal. But if you know about one I still wish to see and compare.

Future
It would be very nice if the pascal source could be edited and compiled within the JVP gui manager. I will build an internal editor in future, if I gain enough requests for JVP. Currently there is no good free command line pascal comiler as I know and it is very hard to me to build my own pascal comiler, so if anyone know about such a compiler, I hope to help me.

Where To Find JVP?
JVP demo is now available on the Aminet at: /pub/dev/lang/jvp.lha

How to contact me?
You may contact me by email:

Torna alla Home Page di AMiWoRLD


Copyright AMiWoRLD
Contact:
petty@amiworld.it
[Made On Amiga]