WebPoint Scripting Language  
home


back  Back to Home Page

Date/Time
◊ EncodeDate
◊ EncodeTime
◊ TryEncodeDate
◊ TryEncodeTime
◊ DecodeDate
◊ DecodeTime
◊ DayOfWeek
◊ Date
◊ Time
◊ Now
◊ DateTimeToUnix
◊ UnixToDateTime
◊ IncMonth
◊ DayOfWeekToInt
 
Formatting
◊ Format
◊ FormatFloat
◊ FormatDateTime
◊ StringToDateTime
◊ DateTimeToString
◊ StringToFloat
◊ FloatToString
◊ IntToStr
◊ FloatToStr
◊ StrToInt
◊ StrToIntDef
◊ DateToStr
◊ TimeToStr
 
File Paths, Names and Extensions
◊ ExtractFileName
◊ ChangeFileExt
◊ ExtractFileExt
◊ ExtractFilePath
◊ FileExists
◊ HideFile
◊ UnixPathToDosPath
◊ IncludeBackslash
◊ ExcludeBackslash
◊ MakeFullFilePath
 
Special Functions
◊ LogMessage
◊ StartPerformanceTimer
◊ EndPerformanceTimer
◊ Soundex
◊ CalcMod10CheckDigit
◊ EncryptString
◊ DecryptString
◊ GetJPEGInfo
◊ GetSessionCut
OverTime
◊ GetAgeAsAtDate
◊ RunPriceEnquiry
◊ ExecuteEFT
◊ MercuryExecuteEFT
 
File and Page Functions
◊ DownloadFile
◊ Echo
◊ SendBinaryData
◊ SendBinaryData
FromVariable
◊ PageParamValue
◊ ClearErrorMessage
◊ MakeErrorMessage
◊ GetErrorMessage
◊ GetValueFromFile
◊ GetValueFromFile
Language
◊ OpenURL
◊ IncludeFile
◊ ProcessFile
◊ ProcessString
◊ SaveToFile
◊ ReadFromFile
◊ GetConstantValue
 
Session Management
◊ CreateNewSessionID
◊ SetSessionID
◊ GetSessionID
◊ FinishSession
◊ FailSession
◊ SessionPath
 
Session Variables
◊ GetSessionValue
◊ SetSessionValue
◊ GetValueAsString
◊ SetValueAsString
◊ GetValueAsInteger
◊ SetValueAsInteger
◊ GetValueAsDateTime
◊ SetValueAsDateTime
◊ GetValueAsFloat
◊ SetValueAsFloat
◊ GetValueAsWideString
◊ SetValueAsWideString
◊ DeleteVariable
◊ ClearVariableArray
◊ GetVariableArray
 
String Functions
◊ StripNonNumerics
◊ StringReplace
◊ StringReplaceIgnore
Case
◊ CheckForChars
 
Mail Sending
◊ SendMail
◊ SendMailToAdmins
◊ SendMailToManagers
 
Database functions
◊ GetBDEWebDatabase
◊ GetAstaWebDatabase
◊ GetAstaWebDataBase
ByName
 
Products and DEF files
◊ FullProductName
◊ CategoryCount
◊ CategoryName
◊ CategoryProperty
◊ AttributeCount
◊ AttributeName
◊ AttributeProperty
◊ ProductCount
◊ ProductProperty
◊ ProductPropertyByID
◊ GetProductIDBySPID
◊ ProductPackageCount
◊ ProductPackage
Property
◊ ProductValidDaysCount
◊ ProductValidDayValue
◊ GuestCardCount
◊ GuestCardProperty
◊ GuestCardIndexByID
◊ ProductRequireCount
◊ ProductRequireID
 
Shopping Cart
◊ CartAddProduct
◊ CartDeleteProduct
◊ CartItemCount
◊ CartReplaceProduct
◊ GetCartProductProperty
◊ SetCartProductProperty
◊ AddShoppingCart
◊ DeleteCartVariable
◊ GetCartValueAsString
◊ SetCartValueAsString
◊ GetCartValueAsInteger
◊ SetCartValueAsInteger
◊ GetCartValueAs
DateTime
◊ SetCartValueAs
DateTime
◊ GetCartValueAsFloat
◊ SetCartValueAsFloat
◊ RunPriceEnquiry
Calculation
◊ RunPriceEnquiryDetails
 
Misc Functions
◊ RunScript
◊ ScriptExceptionMessage
◊ SendBinaryDataAnd Filename
◊ SendBinaryDataFrom VariableAndFilename
◊ LookupExternalString
◊ OpenExternalURL
◊ DBIntToHexColor
◊ OpenURLWithParams
◊ HTMLFriendlyString
◊ Concat
◊ CalcMod10CheckDigit
◊ SendGetParamList
◊ RandomInt
◊ CapitaliseString
◊ GeneratePassword
◊ GetOutputParamList
◊ CreateBarcodeJPEG
◊ SendBarcodeJPEG
◊ ConvertHTMLToPDF
◊ ConvertHTMLToPDF
Params
◊ CopyFile
 
back Back to Home Page

WebPoint WebPoint Scripting Language

Back To Functions 

Overview

WebPoint has the ability to run both Delphi functions and specialised inbuilt functions. The menu on the left lists many of the functions available in WebPoint for you to use in general WebPoint pages. But WebPoint also has the ability for you to create your own functions/procedures within ips scripts. These are called subroutines, and the following information is a brief overview of how to create and use your own Delphi subroutines within ips scripts.

Subroutine Overview

To begin with a subroutine is like a sub-program. It not only helps divide your code up into sensible, manageable chunks, but it also allows these chunks to be used (called) by different parts of your program. Each subroutine contains one of more statements.

In common with other languages, Delphi provides 2 types of subroutine - Procedures and Functions. Functions are the same as procedures except that they return a value in addition to executing statements. A Function, as its name suggests, is like a little program that calculates something, returning the value to the caller. On the other hand, a procedure is like a little routine that performs something, and then just finishes.

Parameters and subroutines

Both functions and procedures can be defined to operate without any data being passed. For example, you might have a function that simply returns a random number (like the WebPoint RandomInt function). It needs no data to get it going.

--- Edit This Later --- Likewise, you can have a procedure that carries out some task without the need for data to dictate its operations. For example, you might have a procedure that draws a square on the screen. The same square every time it is called.

Often, however, you will pass data, called parameters, to a subroutine. (Note that the definition of a subroutine refers to parameters as arguments - they are parameters when passed to the subroutine).

Some simple function and procedure examples

The following code illustrates simple function and procedure definitions:

A procedure without parameters

Code Sample
procedure ShowTime;
begin
// Display the current date and time
Echo('Date and time is '+DateToStr(Now));
end

// Let us call this procedure
ShowTime;
// A procedure with no parameters

Code Output
Date and time is 12/12/2002 15:30:45


back  Back To Home Page

© Copyright 2008 Intouch Technology Group
->