Documentation errata:

Miscellaneous notes and information, not in manual, and manual corrections.

This document contains temporary place to list notes and documentation that is not currently in the manual, and corrections for incorrect information in manuals. They will be removed as they are migrated to manual. Please se manual for updates.


Aubit equivalent of 4js --# comment, or "#IFDEF AUBIT4GL" functionality

Aubit will ignore this two special cases of comments:

{!
    message "you will see this only if you compiled 4gl program using Aubit 4gl"
}

and 

--! message "you will see this only if you compiled 4gl program using Aubit 4gl"

--! is also ignored by Aubit form compiler, fcompile.

Aubit will ignore them as a comment and pass through that code. This is very useful for preserving compatibility between different x4GL compilers, especially when you want to use Aubit specific statements, that are not understood by other compilers. For example, following function will returned "1" only if compiled with Aubit 4gl compiler:

#identify that we are running on Aubit 4gl:
FUNCTION compiler_is_a4gl()
{!
RETURN 1
!}
RETURN 0
END FUNCTION

--! is aubit4gl specific. It doesn't get ignored by Aubit4gl 


Aubit extension to ERROR statement:

ERROR "something" WAIT FOR ANY KEY 

Will display "something", and ask user to press any key - at least in GUI mode - yet to do the TUI


Core dumps debugging notes

Please attempt to fix bugs before reporting them (but do report them if you can't fix them).

Bug reports, fixes, and patches should go to the developers list in "diff -p -c3" or "diff -p -u3" format.

All the 4gl code now compiles with '-g' by default (or at least it did). This means that the gdb debugger can be used.

If you get a core dump, do a 

$ gdb 4glc
gdb> set args myfile.4gl
gdb> run
..
gdb> bt
...

On CygWin, in CUI mode, this just freezes with message:

"Starting program: 4glc.exe hello.4gl"

Your probably not doing this - but just to make sure: in gdb you can't

gdb 4glc.exe hello.4gl

you have to use the "set args" , otherwise it tries to read hello.4gl as a core dump...

You can use "gdb --nw" to run debugger in CUI mode, not GUI

gdb --nw 4glc.exe 4glc.exe.stackdump

Output of typical debugging session:

(gdb) set args hello.4gl
(gdb) run
Starting program: /usr/aubit/aubit4glsrc/bin/4glc hello.4gl

Program received signal SIGSEGV, Segmentation fault.
0x804b5d9 in yyparse () at /usr/lib/bison.simple:248
248 YYPARSE_PARAM_DECL


(gdb) bt
#0 0x804b5d9 in yyparse () at /usr/lib/bison.simple:248
#1 0x805c97d in main ()
#2 0x400abcb3 in __libc_start_main (main=0x805c7b0 <main>, argc=2,
argv=0xbffff564, init=0x804a840 <_init>, fini=0x8084dec <_fini>,
rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffff55c)
at ../sysdeps/generic/libc-start.c:78

FIXME : debug.out description (DEBUG=ALL)

All I can suggest is putting in some debug ("Got to here..") in the code (around the call to yyparse..) and see if you can narrow it down. It may be memory corruption too, have a look for dmalloc in freshmeat...


Note about running A4GL compiled programs in non-interactive mode

The control characters are used to move the cursor etc on your 'terminal'. If you want to get rid - set the NOCURSES environment variable

$ NOCURSES=Yes
$ export NOCURSES

and then run it..

YOU WILL NOT BE ABLE TO USE ANY SCREEN IO COMMANDS

(no error/message/menu/display .. at). You can use 

DISPLAY "All OK"

(With no TO or AT - this is a line mode command).


Note about selecting GTK GUI themes:

To enable the theme, put the following in ~/.gtkrc:

module_path "/usr/lib/gtk/themes/engines"
include "/usr/share/themes/Handheld/gtk/gtkrc"

To build themes (iPaq Linux):

./configure --prefix=/usr --target=arm-linux

This will produce a DSO which is the theme engine. You must copy the .so files to:

/usr/lib/gtk/themes/engines/

and the gtkrc file in Themes/ into:

/usr/share/themes/Handheld/gtk/

Then, to enable it, put the following in your

~/.gtkrc

include "/usr/share/themes/Handheld/gtk/gtkrc"


Notes about RPC in Aubit 4gl

Just how much exactly is RPC built in Aubit compatible with other RPC implementations?

I'm thinking about RPC calls between different languages; for example:

If I can do RPC from PHP code to Aubit, I can make really impressive web browser database applications using PHP to write presentation logic, and still call exiting 4gl code, stripped of presentation logic.

It seems that XML-RPC is becoming standard RPC in OpenSource community, and it's available for many different languages, there is even client for MSIE browser. See here:

http://www.xmlrpc.com/

http://xmlrpc.usefulinc.com/php.html

http://xmlrpc-c.sourceforge.net/

http://xmlrpc-epi.sourceforge.net/

Did you try RPC between Aubit and anything else?

RPC in aubit 4gl is sun's ONC/RPC (this is the one used for NFS), there are a lot of different RPC implementations, all of which are completely incompatible.

In particular, aubit4gl only implements one service, one specific to aubit4gl. Therefore - you can't even call non-aubit4gl sun onc/rpc functions!

If you want XML/RPC (or SOAP as it used to be called I think) - you can always implement it as a C module, within a 4GL function wrapper - you'll see a lot of this in assist.4gl :

FUNCTION myfunc()
DEFINE a INTEGER
code
some_c_function();
endcode
END FUNCTION

RPC to PHP:

http://www.xmlrpc.com/

http://xmlrpc.usefulinc.com/php.html

http://xmlrpc-c.sourceforge.net/

http://xmlrpc-epi.sourceforge.net/


File names extension conventions for Aubit 4gl

Source files:

Intermediate:

Objects:

Executable


Aubit programs, compilers and utilities exit codes

All 4glc exit error codes:

Unable to open map file
#if (only_doing_globals ())
#yyerror (err); 
Out of stack 
Couldnt open output file 
Couldnt open globals fil 
Internal error setting whenever error 
No input 
No input 
Usage %s filename[.4gl] 
Error opening file : 
# x = yyparse (); closemap (); 
Error compiling %s.4gl - check %s.err 
ID %s is unknown to the template 0
List are different length 0
1
0
0
0
0
7
0
0
0
1
1
x
2
0
0

All 4glpc exit codes:

Cannot find /etc/a4glrc, $AUBITDIR/etc/.a4glrc or $HOME/.a4glrc 
Cannot find $A4GLRC 
help messages 
per compile error (from fcompile) $err_code
No C files to compile. 
all errors after 4glc $err_code
all errors after CC $err_code
4glc not returned error code, but .c file was not generated 
4gl file not found 
5
5
6
$
8
$
$
9
10

fcompile

mkmess

runtime

 

 


Note about 4glc performance

4glc compiler is from user perspective not very fast as configured by default. This is because 

1) you made me put in all those reserved words and extra '+' which have pushed it up to 500 odd reduce/reduce's

2) Its compiled with -g

There is currently no way to disabel -g in 4glpc. I wonder if this is really needed as defailt:

if [ "$COMSPEC" = "" ]
then
GCC=${GCC:-"cc -O -g "}
else
GCC=${GCC:-"gcc -O -g "}
 fi

when we have -debug flag for 4glpc ? Especially when compiling large ammounts of code, I'm interested in -g only if it fails?

Like, I do a first run wothout -debug, and it's fast, and it compiles what it compiles. Now I know the rest will fail, so I use -debug...

No, the debug stuff is compiled into the compiler - nothing to do wth what you're compiling... You could have two 4glc's though...

3) Its compiled with bison --debug

This is in 4glc makefiles - this affect 4glc speed only at run-time.

Try setting YYDEBUG=1

as an environment variable and you'll see its effect...

4) You've probably got DEBUG=ALL set

What exactly does this do? My understanding is that it is usefull only together with -g ?

Its my internal debugging (-g is gdb debugging), its what produces the debug .out file

It'll be a lot faster when we're happy that 4glc is working properly.

This is a gprof output for 4glc You can see most o the time is spent in yyparse (which is generated by bison) I may be able to trim a little in 'words' and 'chk_word' - but your dodgey syntax is costing the time !

Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name
45.26 0.43 0.43 1 430000.00 909473.68 yyparse
23.16 0.65 0.22 1336578 0.16 0.17 words
21.05 0.85 0.20 2626 76.16 175.17 chk_word
3.16 0.88 0.03 4878 6.15 8.20 read_word2
3.16 0.91 0.03 chk_str_resource
1.05 0.92 0.01 53487 0.19 0.19 mja_fgetc
1.05 0.93 0.01 2910 3.44 3.44 print_space
1.05 0.94 0.01 380 26.32 26.32 turn_state
1.05 0.95 0.01 set_line
0.00 0.95 0.00 40419 0.00 0.00 ccat
0.00 0.95 0.00 4878 0.00 8.20 read_word
0.00 0.95 0.00 2925 0.00 3.42 printc
0.00 0.95 0.00 2851 0.00 0.00 printcomment
0.00 0.95 0.00 2626 0.00 0.00 set_str
0.00 0.95 0.00 2626 0.00 175.17 yylex
0.00 0.95 0.00 1671 0.00 0.00 mk_word
0.00 0.95 0.00 1632 0.00 0.85 pr_when_do
0.00 0.95 0.00 1427 0.00 0.00 check_for_constant
0.00 0.95 0.00 1123 0.00 0.00 isnum
0.00 0.95 0.00 1014 0.00 0.00 scan_variables
0.00 0.95 0.00 1010 0.00 0.00 strip_bracket
0.00 0.95 0.00 846 0.00 0.00 scan_variable
0.00 0.95 0.00 764 0.00 0.00 downshift
0.00 0.95 0.00 722 0.00 0.00 mja_ungetc
0.00 0.95 0.00 717 0.00 0.00 find_type
0.00 0.95 0.00 440 0.00 0.00 addmap
0.00 0.95 0.00 257 0.00 0.00 inc_counter
0.00 0.95 0.00 252 0.00 37.59 start_state
0.00 0.95 0.00 230 0.00 0.00 start_bind
0.00 0.95 0.00 204 0.00 13.68 prchkerr
0.00 0.95 0.00 169 0.00 0.00 add_bind
0.00 0.95 0.00 137 0.00 0.00 get_counter_val
0.00 0.95 0.00 128 0.00 0.00 add_variable
0.00 0.95 0.00 123 0.00 0.00 dec_counter
0.00 0.95 0.00 117 0.00 0.00 isin_command
0.00 0.95 0.00 114 0.00 3.00 print_variable
0.00 0.95 0.00 114 0.00 0.00 push_name
0.00 0.95 0.00 91 0.00 0.00 push_type
0.00 0.95 0.00 73 0.00 0.00 reset_counter
0.00 0.95 0.00 68 0.00 16.69 print_bind
0.00 0.95 0.00 46 0.00 0.00 setinc
0.00 0.95 0.00 45 0.00 0.00 ispdf
0.00 0.95 0.00 42 0.00 0.00 how_many_in_bind
0.00 0.95 0.00 41 0.00 3.42 print_bind_pop1
0.00 0.95 0.00 40 0.00 0.00 get_curr_rep_name
0.00 0.95 0.00 39 0.00 4.73 pop_blockcommand
0.00 0.95 0.00 39 0.00 3.16 push_blockcommand
0.00 0.95 0.00 23 0.00 0.00 expand_bind
0.00 0.95 0.00 22 0.00 0.00 dump_vars
0.00 0.95 0.00 22 0.00 19.89 print_variables
0.00 0.95 0.00 22 0.00 0.00 system_var
0.00 0.95 0.00 20 0.00 0.00 clr_variable
0.00 0.95 0.00 20 0.00 3.93 incprint
0.00 0.95 0.00 19 0.00 0.00 get_bind_cnt
0.00 0.95 0.00 19 0.00 16.19 print_param
0.00 0.95 0.00 19 0.00 3.42 print_rep_ret
0.00 0.95 0.00 18 0.00 0.00 iscontinuecmd
0.00 0.95 0.00 18 0.00 0.00 set_variable
0.00 0.95 0.00 14 0.00 0.00 convstrsql
0.00 0.95 0.00 14 0.00 0.00 pop_record
0.00 0.95 0.00 14 0.00 6.84 print_record
0.00 0.95 0.00 14 0.00 0.00 push_bind_rec
0.00 0.95 0.00 14 0.00 0.00 push_record
0.00 0.95 0.00 11 0.00 0.00 drop_counter
0.00 0.95 0.00 11 0.00 0.00 new_counter
0.00 0.95 0.00 10 0.00 0.00 pop_all_gen
0.00 0.95 0.00 9 0.00 6.84 add_continue_blockcommand
0.00 0.95 0.00 8 0.00 0.00 set_curr_block
0.00 0.95 0.00 7 0.00 0.00 bname
0.00 0.95 0.00 7 0.00 3.42 push_report_block
0.00 0.95 0.00 6 0.00 0.00 matoi
0.00 0.95 0.00 6 0.00 0.00 push_gen
0.00 0.95 0.00 5 0.00 0.00 attr_code
0.00 0.95 0.00 5 0.00 0.00 colour_code


"loadmap" uttility

in 4glpc there is a call to "loadmap". It can be very useful. This is listing of loadmap.4gl

# Change to the database on the following line to point to the
# database you wish to store your mapfile data in 

database informix
main
define l_fname char(64)

if num_args() > 0 then
let l_fname=arg_val(1)
delete from acl_map where map_module=l_fname
load from l_fname insert into acl_map
if status <> 0 then
exit program
end if
else
display "No file to load"
end if

end main

Remember - this is only an example of what you can do with the map files.


Note about PRETTYC in 4glpc

3) What's the story with "indent" and "$PRETTYC" ?

When you've got a problem with the C code its quite nice to run it through 'indent' to get the indentation right. (Theres a lot of beautifier programs - so you could specify an alternative with PRETTYC).

This takes a while though and doesn't actually do anything useful normally..

Should really be something like :

PRETTYC=${PRETTYC:indent}
if [ "$AUTOINDENT" = "Y" ]
then
$PRETTYC $fname.c
fi


Correction of fcompile command line usage

fcompile [-c] formname[.per] [path/compiledform.ext]

-c will compile form to C code, instead to .afr file

compiling forms to C code

The fcompile -c should compile down to C code - I'll have to investigate why thats bits not working - but thats not what most people want. They want the .frm's and not to use the 'form_is_compiled' function..


Notes / reminders about missing documentation

FIXME: glb files description and usage, lookup paths?

FIXME: how Aubit finds form files, help files ($DBPATH ?)

FIXME: explain ussage of _variable(xxx)

FIXME: new syntax in hello_gui and gui forms

4gl reference:

FIXME: remove all "see..." pages

FIXME: Add Aubit and 4Js specifics

FIXME: way to : search, add anottations


DBPATH should now be implemented

It's tested for forms - but for help files?


Note about "Attribute already used" warning in fcompile

Compiling form P109.per
Attribute already used

I think its a mistake in the compiler when there is a field thats 'LIKE' a table/column.

No, it's actally ATTRIBUTE=(green, green)


 

 

FAQ


Please also see Phorum group dedicated to Aubit 4gl, for more questions and answers, at www.falout.com

Back to top


Q: I'm compiling a 4GL program using fglc, not fglpc, and I see this messages:

4glc hello.4gl
Start state attribute 1
Start state attribute 0
Start state attribute 1
Start state attribute 0

What are they?

A: As for the 'Start state's have a look in the states.c file (probably in 4glc/generated or 4glc/rules/generated) They should not be printed in user versions and were for me during development of the compiler....

The 'states' messages are there because of the menu command - which invokes the states for control keys (eg. f1, f2, control-x etc). Its about the lexer, take the following

define f1 integer (1)
menu
command key(f1) ... (2)
..

in (2) f1 should be function-key-f1, in (1) it should be a variable name.

States are when certain keywords can be accepted. so there is a 'state' for command keys etc. The messages shouldn't be printed though...

Back to top


Q: Can I use Aubit compiled program as CGI for my web server?

A:  Yes. But, there's the bit about taking input from a page into 4gl variables.There is also a small matter of invoking 4gl program from WWW server. How do you make program execute when you put URL, say, www.falout.com/cgi-bin/myprog when myprog is Aubit 4gl compiled code, like your HTML example, and get page displayed in your browser?

If you cannot take input, how different is this from executing the same 4gl code in any other 4gl compiler?

You can invoke you normally by putting it in your cgi bin directory exactly as you say, using the NOCURSES bit disables all the screen setup control codes (eg. clear screen, move curses to top left, etc etc).

How would that call look?

www.falout.com/cgi-bin/myprog?NOCOURSES=1?param3?param3

If I was using it in a CGI mode - I'd probably have a shell script wrapper than passing the NOCURSES in the CGI call:

#!/bin/sh
cat - | my4glprog NOCURSES= $@

(or something similar anyway)

Pity it would not attempt to output regular screen interactions as HTML, but that would probably not make sense anyway since HTML is page oriented, so no action before you submit the whole page... Try 4Js CLI-HTML or Querix HTML stuff.

The other difference between this and other 4gls doing the same thing is that you can embed C code into your own to do virtually anything you want, look at example for that 'list' function - try doing that in 4gl.

The input should be simple too, I'll have a look later at implementing the reading for GET and POST and see what I can find. I was only using this as an example - but it could be useful to provide a fuller example..!

For existing 4gl code it simply does not make sense. The fact that you must operate on the page, not field level, is forcing rewrite of most user interaction logic, so about 30 % of code at least. And it's not easy, and it breaks compatibility. If you write from scratch, then you now have tools like PHP, that are simply FANTASTIC for this task.

Maybe you should forget this HTML stuff for anything but reports. In reports, as Querix is doing, HTML output is really cool.

And after all, HTML is/was designed to be static, and reports are static. Otherwise, I see XML and/or JavaScript as OK for interaction, but I really fell we need real Java applet to run presentation logic for real field level operations, like lookup, pop-up windows, input validation with sub-queries after input on field level, etc... 

But CGI can be complicated, it may be quite easy to write a little library to help the novice do this in 4GL rather than C or shell scripts directly. I repeat - No screen interactions (ie any thing needing keypresses)- these are in fact prohibited in this mode.

Heres an example that could be used for generating HTML pages...

simple_html.4gl:


#################################################
# When run - use the environment variable 'NOCURSES'
# or the command line 'simple_html NOCURSES=YES'
# when running to avoid the normal screen setup

main
    call display_page()
end main

function display_page()
    display "<html>"
    call head()
    call body()
    display "</html>"
end function

function head()
    display "<head>"
    call title("Aubit 4GL")
    display "</head>"
end function

function body()
    call heading("Overview",1)
    # need these in reverse order because of the 4GL stack....
    call list("Item3","Item2","Item1")
end function


function heading(p_string,p_level)
    define p_string char(512)
    define p_level integer

    display "<H",p_level using "<<<",">",p_string clipped,
    "</H",p_level using "<<<",">"

end function

function title(p_string)
    define p_string char(512)
    define p_level integer

    display "<title>",p_string clipped,"</title>"

end function


# This have a variable number of parameters
# so we'll have to pop them off in C
# NOTE: List is in reverse order - thats the order they will be pulled
# off the stack..
#
code
    aclfgl_list(int a) {
    int c;
    char s[256];
    for (c=0;c<a;c++) {
    memset(s,0,255);
    pop_char(s,80);
    trim(s);
    printf("<li>%s</li>\n",s,c,a);
    }
    return 0;
    }
endcode
#######################

When run :

$ ./simple_4gl NOCURSES=YES

<html>
<head>
<title>Aubit 4GL</title>
</head>
<H1>Overview</H1>
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
</html>

Crude example - but add a CGI type interface and you could develop some really neat stuff.

Back to top


Q: What is NCURESES, and what is it used for in Aubit 4GL?

A: The ncurses (new curses) library is a freeware emulation of System V Release 4.0 curses. It uses terminfo format, supports pads and color and multiple highlights and forms characters and function-key mapping, and has all the other SYSV-curses enhancements over BSD curses. 

Download: ftp://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.0.tar.gz

The NOCURSES parameter (see CGI) is just plain ASCII text of what your program outputs, no other controls sent..

One other thing that might be of interest (as I alluded to before) is the NOCURSES option, this suppresses the calls to the curses library.

I agree that NOCURSES making no sense for existing 4GL applications, it not meant for that, ever tried piping a 4gl through another program ?

test.4ge | wc

There are all sorts of ^[[A23 type stuff in there meant to move the cursor around and set colors and stuff.

The windows version of ncurses is called 'pdcurses' which does not implement this call - so if WIN32 is defined (ie. your compiling under windows 95) then it makes one up.

Back to top


Q: What about loadmap.4gl? Is it needed? How is it used and what for?

A: Its an example - yes it is useful..

Good to know. Now I understand how to use it... :-) Please...explain?

Back to top


ODBC related:

Q: at the moment, Aubit compiler is usable only with Informix engines, because syntax differences in SQL, and/or/not because other reasons, that I will put in manual when you reply to this question.

A: You can use it with any engine provided 

1) You use informix syntax (which most other SQLs recognise except for 'outer')

2) or you prepare it first (in which case the 4gl doesnt interpret the SQL and passes it straight back into ODBC

Q: Because of this, it does not make sense to force people to install OpenLink, which is not really easy anyway, since they will need to install some informix engine, and then they can install CSDK easily, maybe even RPM's, that will include CLI ODBC.

A: It shouldn't be limited to just informix, but it should be easy to set up both ICDK, and IODBC.

Q: there is no way currently to take -liodbc from LD_LIBRARY_PATH, and all libraries MUST physically be in $AUBITDIR/extlibs, and this directory name is hard-coded (extlibs), and there is no environment variable, that can change this.

A: Correct at time of going to press, the ODBC_LIB_DIR should be implemented in the 4glpc program...

Q: Since there is no library called libiodbc in Informix CSDK/CLI, compiling the compiler using provided make files is possible using OpenLink only.

A: Quite possibly - I'll investigate - I *have* compiled against the SDK previously..

Q: You have mentioned that you did use Informix ODBC. Can you please describe.

A: I'll try to do it again and let you know how I did it.

Q: I'm confused with the fact that the ODBC driver is linked into compiler. Or is this just Iodbc manager? Can you choose actual driver in runtime/compiletime, without re-compiling compiler? 

A: Its just the manager for iODBC/Openlink, for Informix its the actual driver.. If you compile in a driver manager, yes you can swap and change, I have had connections to two different RDBMS s concurrently doing this.. 

I have written a couple of ODBC drivers myself - maybe bundling one of them is a good idea. One doesn't even connect to a database, but connects to a file, eg

select owner,modified_date,dir_name,file_name from '/tmp/myfile'

owner mike
modified_date 1/1/2000
dir_name /tmp
file_name myfile

or

select file_name from '/tmp' where size>1000

file_name myfile
file_name myfile2
filename coredump

Q: What choices I have for ODBC manager, when linking compiler?

A:

http://www.unixodbc.org

http://www.iodbc.org

As far as I know - the ODBC manager should present a common interface to Aubit 4GL, whether that manager is unixODBC or iODBC.

But in that case, one would ask, why did I need to have iODBC /lib dir present when  compiling? If I understand correctly, only header file should be enough to compile? Not quite - you'll get link errors without the library.

NOTE :It may use some different header files to iODBC (in the same way the iODBC uses different header files to Win32 MS-ODBC)

Normally only the names of the files change so you can just #ifdef around them. Filename is maybe different, but any ODBC .h defining interface should be OK- as far as I can tell...

But in that case, if you compile with iODBC header, you cannot use compiler with unixODBC manager until you recompile the compiler? It is not maybe tragic for compiler, but you also need to recompile all programs, if you need to change ODBC driver. Bit of a git this isn't it ?!

Remember though that unixODBC is specific in some areas (GUI tools) at the last count. It is not as portable as iODBC, and is most definitely harder to compile

From the iodbc mailing list (June '99):
Peter Harvey wrote:

The focus for iODBC is clearly the DM and platform portability while unixODBC is broader in scope with less focus on portability. My feeling is that this *was* a great problem when unixODBC started out but is not much of an issue anymore. Its not an issue anymore because most of unixODBC goals have been achieved, or are on the verge of being achieved, on Linux and so now portability is more in the focus of unixODBC. The extra tools in unixODBC (ODBCConfig, DataManager), the code template, the driver helper libs, and some sample drivers are still important but does not negate the use of a common DM.

Peter Harvey
http://www.codebydesign.com

  iODBC  unixODBC
GUI tools no yes
code template no yes
drvhelper no yes
ODBC drivers no yes
CUI tools yes yes

Now, you compare them, and say: Bugger, if I use unixODBC on Xenix, I will not have GUI configuration, templates, etc, so I'll rather use iODBC and not have them anyway, because of ...Also, GUI part is really no longer issue after qt was ported left and right.

The most important reason for me to look at unixODBC is GUI management. As you would probably agree, people exhibit extraordinary ability to mess up ODBC config files, put them in all the wrong places, etc.

Then again, there in mot much reason not to take just that out of unixODBC and use it with iODBC. Or not.

Q:  Do I even need to link compiler with any manager, after all, .so is for Shared Object?

A: Yes - it needs to resolve them before it can call them. Otherwise a4gl would have to act like a driver manager. Would that be a right thing to do in the future?

No it would mean incorporating an extra ODBC level, adding (say) iODBC into Aubit 4G, to then call an iODBC manager or the unixODBC manager. or the Informix CLI.

Interestingly - I beleive that an ODBC manager can call another ODBC manager as if it was an ODBC driver, so you could link against iODBC, point that to the unixODBC driver which then points to a data source - bit messy though !

We could include iODBC in a4gl distribution, but that would slow things down if we didnt need it ...

Best off posting to the iODBC (freeODBC) mailing list for general help - we are not just talking iODBC and unixODBC. Now that iODBC is GPL - there could be any number of possible DM (data source managers..).

Its an interesting problem - but I dont think the answer is to add an ODBC manager into 4GL directly - you would gain nothing to having it statically linked.

I agree that there is a good chance that unixODBC is the way to go - but all the openlink drivers (for anything other than non-GPL dBs your probably going to be using these) use iODBC, i beleive you said that the informix CLI now uses iODBC too.

With that in mind its probably best keeping things as they are - You can link the 4gl compiler and the resulting codes against one or other at compile time (at the very least - it may also be possible to fudge the shared libraries around) I doubt that in most cases this would be a problem.

The only other consideration is that a4gl always used version 2.0 -> 2.5 (?) of ODBC. iODBC and unixODBC are now 3.0 -> 3.5 compatible - it may be that the way I'm doing things is not the most efficient....

Q: libodbc.so (ODBC Driver Manager): am I correct in assuming I can link Aubit 4GL compiler with that?

A: Yes - probably

Q: Do I even need to link compiler with any manager, after all, .so is for Shared Object?

A: Yes - it needs to resolve them before it can call them Otherwise a4gl would have to act like a driver manager

Q: What is iodbc.h doing in /lib/odbc ?

A: I don't know...

Q: Is there anything iODBC specific in Aubit compiler?

A: No - It compiles up against Windows ODBC too, but the header files have different names (sql.h -> isql.h etc.)

Interestingly - I beleive that an ODBC manager can call another ODBC manager as if it was an ODBC driver, so you could link against iODBC, point that to the unixODBC driver which then points to a data source - bit messy though !

Q: How do I link a4gl with Informix CLI ODBC driver, without using any ODBC managers?

A: This allows for specifying the data required to use the Informix CLI (I'm using Informix Foundation 2000).

The .a4glrc file then has these entries :

ODBC_LIB_NAME=ifcli
ODBC_LIB_DIR=$INFORMIXDIR/lib/cli
export ODBC_LIB_NAME ODBC_LIB_DIR

Informix still needs a .odbc.ini file - so it should be possible to connect to any datasource from the Informix CLI and vice versa (making previous discussions about ODBC managers pretty irrelevant!)

my .odbc.ini file:

[ODBC Data Sources]
Informix7=Informix 7.x ODBC Driver
;
; Define ODBC Database Driver's Below - Driver Configuration Section
;

[Informix7]
Driver=/disks/disk1/informix/lib/cli/iclis09a.so
Description=Informix 7.x ODBC Driver
Database=stores7
HostName=dax
LogonID=informix
pwd=informix
Service=sqids7
Protocol=onsoctcp
Servername=ids7

So, you can link a4gl to CLI, and connect to PostgreSQL, just by defining a section in .odbc.ini, although I have not tested this.

Back to top


Q: Is Aubit 4GL thread-safe?

A: One thing I would like to add would be threads - but that starts getting complicated because of the 4GL stack.

Jonathan Lefller once posted some discussion about this, and I think it looked not-so-tragic-but-not-trivial. I think he's main problem was ESQL/C at the time, but they are treaded now, and we don't need them anyway.

The main problem as far as we are conserned is our 4gl stack which expects to be linear, if you have threading, each thread must use a different stack.

Back to top


Q: Ok, first project will be...err...Java GUI client for Aubit 4gl! Where do we start?

A: I added all the hooks one could think of - it shouldn't be too difficult to do.

I did start work on a VB front end - but didn't get very far.

Quick overview - have a look in lib/gui.c & lib/gui_io.c

when the 4gl application starts - the parameters to it are pre-processed before making them available to arg_val.. There are currently two options

NOCURSES=...

and

GUIPORT=...

For the NOCURSES you just need a value after the equals. For 'guiport' it starts listening at the given service port for a tcp/ip connection.

eg.

test1.4gl :

main
display "Hello"
end main

if you compile this to be test1 then run it

$ ./test1 GUIPORT=2000

then on another terminal

$ telnet <yourmachine> 2000 # mine is called 'dax'

you get something like :

bash-2.02# telnet dax 2000
Trying 192.168.1.7... # printed by telnet
Connected to dax.
Escape character is '^]'.

STARTGUI # printed by the GUI bit of 4gl
MKWIN screen 1 1 80 24 0 8052b78
WREFRESH 8052b78
CURRWIN 8052b78
CURRWIN 8052b78
WREFRESH 8052b78
REFRESH
REFRESH
REFRESH
MOVE 1 1
REFRESH
REFRESH
REFRESH
PRINT 0 "Hello"

Connection closed by foreign host.

Also, take a look at WTK (GNU) code  from Bruickner & Jarosh

http://www.bj-ig.de/wtk.html

Why not take this as front-end to start with, if it was good enough for 4Js? They made they GUI front-end using this.

There are utilities on www.freshmeat.net which will allow you to proxy this conversation and have a look at what's being passed. Have a look for 'sniffit' it can generate log files for connections via ports and has an interactive mode too.

Back to top


Q: What is thing called Bison doing with Aubit 4GL?

A: Best bet on bison is get a book! Most Unix programming books will cover it. The user never sees the bison bit - its just for the compiler writers.

The section I posted you looks for 'DEFER INTERRUPT" or "DEFER QUIT" and if it finds it in the file your compiling it performs the printc actions...

You will not *need* to learn bison, but if you want to modify any of the compiler then you might want to. Its very straightforward :

A simple example :

defer_cmd : DEFER_INTERRUPT {printc("def_int();");}
| DEFER_QUIT {printc("def_quit();");}
;

printc is part of the aubit4gl library for printing to the generated C file. Having the _cmd is preprocessed by some of my scripts to mean it can be used anywhere a normal command can.(Eg. sleep_cmd is defined, display_cmd etc.etc)

Back to top


Q: What about directory structure of source distribution?

A: The basic idea of the directories was:

/
/compilers            where compilers should go
/4glc                    Code for compiling .4GLs
/fglcompile           Code for compiling .frms
/bin                      Binaries
/lib                       Library source code
/incl                      Library Includes (used to compile the compilers and libraries)
/incl                      Include files for 'c' files generated by 4glc
/project                Versioning info etc.

In directories there may be another 'bin', and/or 'generated' directories 'bin' would contain any scripts used to generate some source code 'generated' would contain any generated source code (ie. wouldn't normally be distributed as part of the source code)

libincl is a directory that contains all the headers needed to compile the compiler (and the associated library).

If you cd to the lib directory - it should be a directory under there. These are *not* needed by the programs you compile, at the moment the only header needed by that is '4glhdr.h' (or something similar)

Back to top


Q: I get core dump when trying to compile 4gl program. How can I find out where is the problem?

A:  try setting

DEBUG=ALL
export DEBUG

Then, compile:

4glc hello.4gl

This should generate hello.c and a debug.out file. With a simple hello.4gl :

main
    display "Hello"
end main

Generates :

#define fgldate long
#include "4glhdr.h"
#include "hello.h"
static char _compiler_ser[]="XXXXXXXXXX";
static char _module_name[]="hello.4gl";
main(int argc,char *argv[]) {
fgl_start(argc,argv);
push_char("Hello");
push_int(-1);push_int(-1);
display_at(1,0x0);
if (sqlca.sqlcode !=0 || status !=0 || 0) {
if (sqlca.sqlcode<0&&status==sqlca.sqlcode) chk_err(2,_module_name);
if (status<0) chk_err(2,_module_name);
}
fgl_end();
}

Back to top


Q: When trying to compile the compiler, I get macro `wattr_get' used with just one arg:

cc -O2 -Wall -I../libincl -I. -DAUTOBANG -DDEBUG -I./odbc -c
curslib.c -o curslib.o
curslib.c:2685: macro `wattr_get' used with just one arg
make[1]: *** [curslib.o] Error 1

A: see NCURSES Q&A

Back to top


Q: I've already got normal CVS - is there anyway of pulling that into use for development CVS repository access at www.falout.com?

A: Unless I open pserver port on my router, no. It is possible, but jCVS client (Java + Swing) is really simple, and it is using it's own servlet on my server, so the communication is going on http port. At the same time, it will run on Linux, and it is really easy to work with.

Another option is WinCVS, that is more or less same stuff as jCVS, but it is using pserver, so I would need to open the pserver port.

Since WinCVS is more powerful, you might consider using jCVS just to import files from my server, then work on local files with WinCVS (if you have a Windows box) and then return stuff to the repository using jCVS.

But I think when you see jCVS client in action, you will see it is really easy, and very good for what we need.

The point is, it took me only few hours to make jCVS client work, and we need to think about other people that will join us too. jCVS is presenting repositories as tree menu of files, and the GUI was always good for simplifying file oriented tasks.

Reasonably useful manual is included, and if you install JavaHelp (that is also provided as part of client, just make sure it is in the CLASSPATH), you will get context sensitive help too.

Back to top


Q: Is there any way I can not use Keystone?

A: No! If you don't know how to use it, you can browse Keystone manual at

http://www.stonekeep.com/ksonline/docs/docindex.html

You should receive automatic slip assign notification for the task of Initial CVS repository import.

Back to top


Q: How about x4GL and PHP? Is there a library for 4GL constructs?

A: x y started working on one. He said:

"If you truly wish to see some of my I can attach some files. I can't say it is in a form anywhere near complete and it alsoinvolves PHPLIB and PDFLIB stuff."

Back to top


Q: Can I compile Aubit 4gl on Windows?

There are two ways you can (try) to do this: Using UNIX POSIX compatibility layer and libraries, like CygWin, or using native Windows platform compiler, like Microsoft Visual C++

CygWin issues:

FIXME: describe CygWin

gcc + ncurses + tools = http://sources.redhat.com/cygwin/

contains:

ash autoconf bash binutils bison byacc bzip2 clear common crypt cygwin dejagnu diff expect fileutils findutils flex gawk gcc gdb gperf grep groff gzip inetutils less login m4 make man mt opengl openssh openssl patch regex sed shellutils tar tcltk termcap texinfo textutils time vim w32api cvs gdbm gettext jbigkit jpeg libpng ncurses readline tiff xpm zlib

Cygwin contrib. also contains PG:

    ftp://mirror.aarnet.edu.au/pub/cygwin/contrib/postgresql/

GTK+ http://user.sgic.fi/~tml/gimp/win32/

What about ODBC?

Issues:

MS Visual C++ issues:

FIXME: Why use VC, where is code, how to compile

There was (is) a native port which compiles using Visual C

Back to top


Q: How should makefiles for Aubit 4gl look like?

FIXME: describe JL's make files, and note examples in IDE/

Back to top


Q: What GUI options, other then GTK+ ?

There was VB code once .I've got to reintegrate it all - it was written in VB (ie non Linux).

Back to top


Q: Is there any compatibility between Aubit 4gl and 4Js 4gl extended syntax?

Incorporated in fcompile are WIDGET and CONFIG fields from the 4Js forms syntax - they are compiled by the form compiler, and placed into the .frm - but 4gl doesn't use them at all yet...

Back to top


Q: What format are compiled forms in, and how is Aubit4gl using XDR and RPCGEN?

Try:

    $ man xdr

Its a universal way of storing data which can be read on any platform.  Its normally used for ONC RPC calls, but I've used it to save the form data. In this way, a form compiled under unix can be run under windows without recompiling it. XDR always converts to the local format.One of the nice things about it is that there is a program called 'rpcgen' which is used to create ONC RPC programs, this takes a definition file ( .x extension) and compiles a ..._xdr.c file - this handled the loading and saving of data for you. Using this is how I managed to get forms compiled into 'C' code written so quickly...

    fcompile -c formname

generates formname.c which is a dump of the xdr data.

Back to top


Q: Can I run Aubit 4gl applications over the Internet, inside my web browser?

See Aubit GUI page for pictures. There is one there that shows Aubit 4gl running on Linux with display on W2K via VNC Java running as applet inside MS Internet explorer using Sun plug-in JVM. Visit http://www.falout.com/projects/Aubit4GL/AubitGUI/aubit_4gl_gui.htm

Back to top