- Subject: [slang-users] Some Collaboration Requested ....
- From: Ben Duncan <ben@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Apr 2005 15:02:00 -0500
I am soon to be moving into my 2nd phase with SLAG, the S-Lang Application
generator. Menu System (fully Mousable) is done, and I am re-writing the
"screen" and data input routines using more of the S-Lang C features
available (such as push'ing and pop'ing things to/from the stack).
The second phase is going to be the integration of a File Manager into
SLAG/S-lang. I have decided NOT to use a SQL database, since the Business
Applications generated with SLAG need to be as maintenance free as possible.
I already have a good deal of "models" into what files, fields, field types,
need to be and contain to create AR/AP/OE/IV/GL/PO/BOM/JC/BankRec/PR/FA and
just about any type of other business application you want to name.
I am looking at using one of the two following:
http://www.ittia.com/products/overview.html
or
http://sourceforge.net/projects/vbisam
What I am going to need to some help on, is writing a "generic" file
manager for one of the above. What I would like to accomplish is having
the "file" (structure) layout defined in a S-Lang script and being able,
without any custom "C" code access on to several of the files.
And example being (S-Lang style):
% ----------- Example Code ------------------
typedef struct
{
CUST_ID , % integer
CUST_NAME, % Character String max 60
CUST_ADDR, % Character String Max 60
CUST_CITY, % Character String max 30
CUST_STATE, % 2 Characters
CUST_ZIP, % 10 Characters
CUST_PHONE, % 11 Chacracters
CUST_BALANCE, % Float
CUST_STATUS ...... (and so on)
} CUSTOMER_RECORD ;
typedef struct
{
OI_CUST, % integer
OI_DOC_DATE, % integer
OI_DOC_TYPE, % 1 Character
OI_DOC_BALANCE % float .... (and so on)
} OPEN_ITEM_RECORD
attribute CUST_FILE ;
attribute CUSTOMER = CUSTOMER_RECORD ;
attribute OPEN_ITEMS ;
attribute DOCUMENTS = OPEN_ITEM_RECORD ;
attribute FILE_STATUS ;
CUST_FILE = opendatafile("CUSTMAS", "RW", "N") ; %Filename, openmode, exclusive lock
if ( CUST_FILE == -1 )
{
errorroutine ;
exit (0) ;
}
OPEN_ITEMS = opendatafile("OPENITEMS", "RW", "N") ; %Filename, openmode, exclusive lock
if ( OPEN_ITEMS == -1 )
{
errorroutine ;
exit (0) ;
}
startdatafile(CUST_FILE, "GE", "" ) ; %Filename, Start Mode, Item Key
FILE_STATUS = readnextdf(CUST_FILE, CUSTOMER) ;
% Heee Heee ... USE COBOL file status CODES so we can
% convince COBOL programmers to use SLAG !!!!
if (FILE_STATUS == 10 )
{
end_file_routine () ;
... exit normally
}
... and so on and so on!!!!
% End Sample Code Here .........................
Sooo... what I am trying to do is use a "generic" File Module that can be passed
the values, and return the record into a structure defined in S-Lang. But I think
for the time, such a Module is above my ability to write it.
Any takers on this ? John? Paul? ...
As always, thanks
--
Ben Duncan - VersAccounting Software LLC 336 Elton Road Jackson MS, 39212
"Never attribute to malice, that which can be adequately explained by stupidity"
- Hanlon's Razor
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html
[2005 date index]
[2005 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]