Klik op het logo voor hulp op afstand
  
 
 
 
 
 
 
 




Scripting Function Reference C


Calculate ([Dmode]) : D

JoPPS

 

Start calculations according to the current calculation mode. Updates the result database and if successful the selected reports are regenerated.

î      The optional Dmode argument overrides the current calculation mode.

      Possible values are:

Calculation mode constants

Meaning

CALCMODE_GROUP

calculate current assembly only

CALCMODE_PROJECT

calculate current project

CALCMODE_BATCH

calculate all open projects in batch, opens the "batch dialog"

CALCMODE_PTABLE

calculate pricetable information for current assembly

 

ì       The returned value is the calculation status, 0 means calculations completed without errors otherwise the last errorcode is returned.

7      Example :

 

IF !ResultsValid() THEN

{

  mode := GetCalcMode();

  IF mode <> CALCMODE_PROJECT THEN SetCalcMode(CALCMODE_PROJECT);

  Calculate();

  SetCalcMode(mode); /* restore previous calcmode */

  Kill("mode");

};

 

&     SetCalcMode, SetUI, SetBatchParams, SetPTableParams, UpdateReports, ResultsValid

&    Refer to 3. Using JoPPS-Script in JoPPS for more information on the calculation mode.

 

CallPluginRoutine( ? ) : ?

JoPPS – V2.82

 

To be documented.

 

CanSendMail( ? ) : ?

JoPPS/JCALL/JScripter – V2.82

 

To be documented.

 

 

CEIL (D) : Dceil

JoPPS/JCALL/JScripter

 

Call Ceil to obtain the lowest integer value greater than or equal to D.

î       D-type value to be rounded.

ì       Dceil is the rounded value.

 

7     Example :

CEIL(-2.8)       returns -2
CEIL(2.8)         returns 3
CEIL(-1.0)        returns -1

 

&     FLOOR

 

ChangeFileExt (Sfn,Sext) : S

JoPPS/JCALL/JScripter

 

Changes the file extension for a given filename.

î       Sfn is the given filename, Sext is the new file extension.
ì       The resulting filename.

 

7     Example :

 

/* get current result */

slot := ReportInViewer();

IF slot 0 THEN Fatal("No result");

IF !ReportHasResult(slot) THEN Fatal("Report has no result");

/* get default fn for result */

fn := GetParam("REPORTDOC");

/* make bak file if already exists */

IF FileExists(fn) THEN

{

  bak := ChangeFileExt(fn,".bak");

  IF FileExists(bak) THEN DeleteFile(bak);

  RenameFile(fn,bak);

};

 

/* save result */

StrToFile(GetResultStr(slot),fn);

 

&     ExtractFilename, ExtractFilePath, ExpandFilename

CharIn () : S

JCALL

 

Reads a character from the standard input stream.

 

The script execution is paused until a character is available in the input stream.

ì       The returned string is one character long and holds the character read.

 

&     KeyIn, LineIn, KeyPressed

 

CharOut (Dascii)

CharOut (Schar)

JCALL

 

Writes a character to the standard output stream.

î      Dascii is the ASCII value for the character to output.
    Schar is the character to output

&     LineOut, TextOut

CHR (Dascii) : S

JoPPS/JCALL/JScripter

 

Returns the character for a specified ASCII value.

î      Dascii is the ordinal value of the character to return.

      Dascii must be in the range [0..255].

ì     The returned string contains the resulting character and is one character long.

 

&     ORD 

ClearMsgPane()

JoPPS

 

Clears the message in the JoPPS message pane.

&     OutputMsg, OpenMsgPane, CloseMsgPane

&    see also 3. Using JoPPS-Script in JoPPS

CloseFile(Dh)

JoPPS/JCALL/JScripter

 

Closes the file specified by the filehandle Dh.

&     OpenFile, OpenRead, OpenWrite

CloseMsgPane()

JoPPS

 

Closes the JoPPS message pane.

&     OpenMsgPane, ClearMsgPane, OutputMsg

&    see also 3. Using JoPPS-Script in JoPPS

ColorToString( ? ) : ?

JoPPS/JCALL/JScripter – V2.82

 

To be documented.

 

CompareStr (S1,S2) : D

JoPPS/JCALL/JScripter

 

Compares two strings. (case-sensitive)

î     S1 and S2 are the strings to be compared.


ì     The result of the comparison. Returns 0 if both string arguments are equal.
      If S1 is greater than S2, CompareStr returns an integer greater than 0.
      If S1 is less than S2, CompareStr returns an integer less than 0.
      The CompareStr function is case-sensitive.


&     CompareText

CompareText (S1,S2) : D

JoPPS/JCALL/JScripter

 

Compares two strings. (non case-sensitive)

î      S1 and S2 are the strings to be compared.

 

ì      The result of the comparison. Returns 0 if both string arguments are equal.
      If S1 is greater than S2, CompareText returns an integer greater than 0.
      If S1 is less than S2, CompareText returns an integer less than 0.
      The CompareText function is not case-sensitive.


&     CompareStr

Confirm (SD[D]) : D

JoPPS/JCALL/JScripter

 

AskYN variant except for the first argument: the title for the message box.

 

For more information refer to the function AskYN.

&     AskYN

CopyFile (Sfrom, Sto) : B

JoPPS/JCALL/JScripter

 

Duplicates a file.

î      Sfrom is the full file specification of the file to duplicate,
      Sto defines the location and fullname for the new file.

 

ì       Returns TRUE when the operation was successful.

&     CopyFileTo, MoveFile, RenameFile

 

M      If the file Sto already exists it is overwritten without notice.

CopyFileTo (Sfrom, Sdestination) : B

JoPPS/JCALL/JScripter

 

Copies a file to a specified destination. The new file gets the same name as the original file Sfrom.

î      Sfrom is the full file specification of the file to copy.

      You can pass filenames using wildcards as well.
    Sdestination is the location (folder) for the new file.

 

ì       Returns TRUE when the operation was successful.

&     CopyFile, MoveFile, RenameFile

 

M     If the destination file already exists it is overwritten without notice.

COS (Dangle) : D

JoPPS/JCALL/JScripter

 

The COS function calculates the cosine of a given angle D (in degrees).

î       Dangle is the angle in degrees.

 

ì       The cosine of the given angle.

 

&     ACOS, SIN, ASIN, TAN, ATAN

CreateBitmapFile(Oatom,Sfn,Dw,Dh,B,Bcolour,Dscale,Dscenario,Dview,Dreso,Dframeref,Dventref) : B

JoPPS - v2.50

 

Creates a bitmapfile (Windows BMP file) representing the given atom object.

î      Oatom is the atom object (not a PROJECTDATA object),
      Sfn is the filename of the file to create,
      Dw and Dh specify the bitmap dimensions (width & height),
      B switches measurements on or off (False=off, True=on),
      Bcolour switches colour on or off (False=b/w, True= colour),
      Dscale if different from 1 (eg. 1/50=0,02),
      Dscenario is the scenario to use (0..7),
      Dview determines the viewers position (-1=as defined, 0=inside, 1=outside),
      Dresol specifies the output resolution (specify 120 for 120dpi)

      Dframeref specifies frame origin for position measures (-1=as defines, 1=frame, 2=part)
      Dventref specifies vent origin for position measures (-1=as defines, 0=vent, 1=frame, 2=part)

ì       Returns True if the file was created successfully.

 

&     CreateMetaFile

CreateFile (Sfn) : Dh

JoPPS/JCALL/JScripter - v2.0

 

Creates and opens a file.

î       Sfn is the filename of the file to create.

 

ì       Returns a valid filehandle Dh or a value of -1 if failed.

      The file is opened in OPENMODE_READWRITE mode.

 

&     OpenFile, OpenRead, OpenWrite, CloseFile

 

M     Close the file using the CloseFile function when you are done using it

CreateMetaFile(Oatom,Sfn,Dw,Dh,B,Bcolour,Dscale,Dscenario,Dview,Dresol,Dframeref,Dventref) : B

JoPPS - v2.50

 

Creates an enhanced metafile (Windows EMF file) representing the given atom object.

î    Oatom is the atom object (not a PROJECTDATA object),
      Sfn is the filename of the file to create,
      Dw and Dh specify the bitmap dimensions (width & height),
      B switches measurements on or off (False=off, True=on),
      Bcolour switches colour on or off (False=b/w, True= colour),
      Dscale if different from 1 (eg. 1/50=0,02),
      Dscenario is the scenario to use (0..7),
      Dview determines the viewers position (-1=as defined, 0=inside, 1=outside),
      Dresol specifies the output resolution (specify 120 for 120dpi)
      Dframeref specifies frame origin for position measures (-1=as defines, 1=frame, 2=part)
      Dventref specifies vent origin for position measures (-1=as defines, 0=vent, 1=frame, 2=part)

 

ì      Returns True if the file was created successfully.

 

&     CreateBitmapFile

 




 |  History  |
 
 

 
 
 
TECHWIN SOFTWARE
De Regenboog 11
B-2800 Mechelen
T +32(0)15 44 64 64
T +31(0)30 899 32 15 Nederland