Procedures in Libraries 
Author Message
 Procedures in Libraries

Thanks to this forum, my Paradox programs have now grown sophisticated enough
for me to want some of my longer procedures placed in a library for all of my
forms to use.

I followed all of the steps in the on-line help, but still get a procedure not
found error.  I believe the problem is that I just cut and pasted my proc's
into a library then did the appropriate Uses and lib.open.  

The documentation states *** You can't call a library's procedures from outside
the library ***.   How do I then convert these into methods which it says are
callable.  When I tried to just create a new method with the procedure's name,
it didn't work.

Thank you

Wristdoc



Thu, 05 Sep 2002 03:00:00 GMT
 Procedures in Libraries

Hi.

Right-click on the lib (after opening in design, of course <g>) and select
"<New Method>".

A sample LIB method is below, along with the USES section for a form.

HIH.

Russ

LIB method:
method AppNameGet()string

; this method returns a string constant
; for the title boxes on each form.

 return(appName)

endMethod

USES section for the form:
AppNameGet()  String

sample call to the lib:
Titl2 = UtilLib.AppnameGet()

Quote:
>Thanks to this forum, my Paradox programs have now grown sophisticated enough
>for me to want some of my longer procedures placed in a library for all of my
>forms to use.

>I followed all of the steps in the on-line help, but still get a procedure
>not
>found error.  I believe the problem is that I just cut and pasted my proc's
>into a library then did the appropriate Uses and lib.open.  

>The documentation states *** You can't call a library's procedures from
>outside
>the library ***.   How do I then convert these into methods which it says are
>callable.  When I tried to just create a new method with the procedure's
>name,
>it didn't work.

>Thank you

>Wristdoc

Russ Carmichael

'You can't be a Real Country unless you have a BEER and an airline. It helps if
you have some kind of a football team, or some nuclear weapons, but at the very
least you need a BEER'  Frank Zappa


Fri, 06 Sep 2002 03:00:00 GMT
 Procedures in Libraries
Hello there !

Here is an example using library to communicate datas between
differents forms

IN THE LIBRARY :

Declaring a new type

Type
  TabloMagic = DynArray[] AnyType
endType

Declaring a new var based on the new type

Var
  VarAppli TabloMagic
endVar

Method to Put data in the TabloMagic

method PutGlob(NomVar String, ValeurVar AnyType)
  VarAppli[NomVar] = ValeurVar
endmethod

Method to Get data from the TabloMagic

method GetGlob(NomVar string) anyType
  return VarAppli[NomVar]
endmethod

NOW IN A FORM :

Uses ObjectPal
   GetGlob(NomVar string) anyType
   PutGlob(NomVar string, ValVar anyType)
endUses
method pushButton(var eventInfo Event)
var
   LibGen Library
endVar
if not LibGen.open(":myAlias:myLibrary")
then
   errorShow()
    return
endif

LibGen.putGlob("toto",123)
view(LibGen.getGlob("toto"))

endMethod

THAT'S ALL.

Please, visit :
http://perso.club-internet.fr/brouardf/Paradox_SQL.html

Frederic BROUARD - AMARIS SA Ile de France
Paradox - Delphi - SGBDR / RDBMS - SQL
http://perso.club-internet.fr/brouardf

Wristdoc a crit :

Quote:

> Thanks to this forum, my Paradox programs have now grown sophisticated enough
> for me to want some of my longer procedures placed in a library for all of my
> forms to use.

> I followed all of the steps in the on-line help, but still get a procedure not
> found error.  I believe the problem is that I just cut and pasted my proc's
> into a library then did the appropriate Uses and lib.open.

> The documentation states *** You can't call a library's procedures from outside
> the library ***.   How do I then convert these into methods which it says are
> callable.  When I tried to just create a new method with the procedure's name,
> it didn't work.

> Thank you

> Wristdoc



Sat, 07 Sep 2002 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. DB Library error or assertion when cancelling a long running procedure

2. Libraries of Stored Procedures

3. DB-Library from extended procedure?

4. Perl Library to execute stored procedure calls to MS-SQL Server

5. Writing and Extended Stored Procedure using Db-Library?

6. Can DB-Library execute Stored Procedures??

7. Speed: DB-library and Store procedure???

8. DB-Library: Login incorrect. message in stored procedure

9. DB-Library: Login incorrect. In stored procedure executing

10. External library procedure error


 
Powered by phpBB® Forum Software