1. a new library
I have a written a new library called mixedlib.e and if anyone is
interested in it, I will send it to RDS for distribution.
The mixed library is a general pupose library that can be used to build
parsers, filters, macro or preprocessors, xbase file programs, games, etc.
and new features will be added if any interest grows in it's routines.
The future direction will be depend on users interests.
The library features:
Memory based ANSI "C" string handling
Standard "C" string routines
Demonstrates easier use of assembler
"C" string output from memory to device or file
Memory based structures that can be written to and from disk
"C" variable types
The purpose of this library is to introduce the Euphoria programmer
to the techniques of using assembler and "C" code in a Euphoria Program.
I have used extensive comments in the library to help the Programmer to
understand what is happening in the library. The library is called the
mixed library because it is a mix of languages and has a mix of uses.
The library's string handling routines are the same as "C" zero terminated
strings. The strings are NOT seqeunces but are memory based strings with
a zero terminating byte. The strings supported are the same as those used
by ANSI "C" and work the exact same way. This enables the programmer
to easily migrate "C" string applications to Euphoria. The structures are
declared in a form that makes it easy to forget about offsets.
The latest version of Pete's ASM.E is required for the assembler routines.
This should be included with the mixedlib.e. Because the library is a
a general library it will be difficult to give extensive demos. The idea
is for the user to be creative enough to create the demos.
This is an example of using strings ( just like "C" )
atom str1, str2, str3
str1 = string(255) -- create an empty string storage
str2 = string("Hello Euphoria") -- create an intialize string
str1 = strcpy(str1, str2) -- copy string2 to string1
str1 = strupr(str1) -- convert str1 to all upper-case
and so on just look in any "C" book and you see how to use them
This is an example of using structures
-- Allocate some structure pointers
pointer record1, record2
-- Define a record structure in high or low mmemory
-- the member can have any name, data type and size
record1 = struc(" FName: string : 25 "&
" LName: string : 25 "&
" Age : byte : 1 "&
" Memo : string : 200 ",
HIGH) -- allocate in high memory
Sets(record1, "Memo", "\nThis is a memo\n"& -- embed special characters
"and should be on\n"& -- or you can parse the field
"more than 1 line\n") -- using the string functions
Sets(record1, "Age", 22) -- set age to 22
Sets(record1, "FName", "Sammy") -- set the structure's field
-- it will be truncated if > 25
-- which was its declared size.
record2 = dups(record1,LOW) -- duplicate the same record in
-- low memory
cout(1,Gets(record2,"FName")) -- use cout to output null
-- terminated strings to any file
-- or device
The structures can written in blocks to and from memory to a file
Maybe one of you xbase experts could use it write a database
Bernie
2. Re: a new library
THis looks pretty nice, I especially like the structures. I'm very interested
in it, please, send it to RDS!
Regards,
Greg
Bernie Ryan wrote:
> I have a written a new library called mixedlib.e and if anyone is
> interested in it, I will send it to RDS for distribution.
>
> The mixed library is a general pupose library that can be used to build
> parsers, filters, macro or preprocessors, xbase file programs, games, etc.
> and new features will be added if any interest grows in it's routines.
> The future direction will be depend on users interests.
>
> The library features:
>
> Memory based ANSI "C" string handling
> Standard "C" string routines
> Demonstrates easier use of assembler
> "C" string output from memory to device or file
> Memory based structures that can be written to and from disk
> "C" variable types
>
> The purpose of this library is to introduce the Euphoria programmer
> to the techniques of using assembler and "C" code in a Euphoria Program.
> I have used extensive comments in the library to help the Programmer to
> understand what is happening in the library. The library is called the
> mixed library because it is a mix of languages and has a mix of uses.
>
> The library's string handling routines are the same as "C" zero terminated
> strings. The strings are NOT seqeunces but are memory based strings with
> a zero terminating byte. The strings supported are the same as those used
> by ANSI "C" and work the exact same way. This enables the programmer
> to easily migrate "C" string applications to Euphoria. The structures are
> declared in a form that makes it easy to forget about offsets.
>
> The latest version of Pete's ASM.E is required for the assembler routines.
> This should be included with the mixedlib.e. Because the library is a
> a general library it will be difficult to give extensive demos. The idea
> is for the user to be creative enough to create the demos.
>
> This is an example of using strings ( just like "C" )
>
> atom str1, str2, str3
>
> str1 = string(255) -- create an empty string storage
> str2 = string("Hello Euphoria") -- create an intialize string
> str1 = strcpy(str1, str2) -- copy string2 to string1
> str1 = strupr(str1) -- convert str1 to all upper-case
>
> and so on just look in any "C" book and you see how to use them
>
> This is an example of using structures
>
> -- Allocate some structure pointers
> pointer record1, record2
>
> -- Define a record structure in high or low mmemory
> -- the member can have any name, data type and size
>
> record1 = struc(" FName: string : 25 "&
> " LName: string : 25 "&
> " Age : byte : 1 "&
> " Memo : string : 200 ",
> HIGH) -- allocate in high memory
>
> Sets(record1, "Memo", "\nThis is a memo\n"& -- embed special characters
> "and should be on\n"& -- or you can parse the field
> "more than 1 line\n") -- using the string functions
>
> Sets(record1, "Age", 22) -- set age to 22
>
> Sets(record1, "FName", "Sammy") -- set the structure's field
> -- it will be truncated if > 25
> -- which was its declared size.
>
> record2 = dups(record1,LOW) -- duplicate the same record in
> -- low memory
>
> cout(1,Gets(record2,"FName")) -- use cout to output null
> -- terminated strings to any file
> -- or device
>
> The structures can written in blocks to and from memory to a file
>
> Maybe one of you xbase experts could use it write a database
>
> Bernie
3. Re: a new library
Anything that'd make the job of writing a parser easier is interesting to me
(so send it to rds).
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
4. Re: a new library
----- Original Message -----
From: stab master <stabmaster_ at HOTMAIL.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, February 05, 2000 5:24 PM
Subject: Re: a new library
> Anything that'd make the job of writing a parser easier is interesting to
me
> (so send it to rds).
I agree!
Kat
5. Re: a new library
I have sent the library to RDS archive
I hope it is usefull. No money back guarantees.
Bernie
6. Re: a new library
-----Original Message-----
From: Bernie Ryan <bwryan at PCOM.NET>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Sunday, February 06, 2000 10:38 AM
Subject: Re: a new library
>I have sent the library to RDS archive
>
> I hope it is usefull. No money back guarantees.
>
> Bernie
Hi Bernie.
I'm looking forward to seeing your new library.
Mark
7. Re: a new library
-------Phoenix-Boundary-07081998-
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: Quoted-printable
Hola, Bernie Ryan escribi=F3 el 2000/02/05 12:23:43:
It looks really interesting, specially if it offers an easy way to deal
directly with output from DLLs and I liked struct declarations too.
> Memory based ANSI "C" string handling
> Standard "C" string routines
> "C" string output from memory to device or file
> "C" variable types
>
Hasta pronto,
Fabio
-------------------------------------
Fabio Ramirez R.
Administrador Red Viceadministrativa
-------------------------------------
-------Phoenix-Boundary-07081998---