Contents:

 

 

Introduction


News blog


What is Servoy?


Getting Started


Comparison Servoy/VFP


Performance


How-To's

 

Code Reference

 

VFP2Servoy Toolkit

 

 

Contact / feedback

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VFP to Servoy Code Reference



The idea behind this page is to provide an extensive list of coding practises that are familiar in Visual FoxPro and show their counterpart in Servoy.

 

Of course Visual FoxPro and Servoy are very different in a lot of areas but there are many similarities too. You should also realize that Visual FoxPro is much more a low-level programming language than Servoy where a lot of functionality is taken care of automatically. So if a syntax counterpart is not present in Servoy that is not necessarily a bad thing.

 

Filling this page is a daunting task that will take forever and will never be complete. However, some of you have offered to assist in contributing to this site. Ideally, with your help, this page could be filled rapidly with lots of valueable content so please contribute!

 

Based on the information below we could build a library with functions that work exactly the same as in FoxPro (a VFP Toolkit for Servoy so to speak). But I believe it's better to learn the language as intended and keep your programs maintainable/exchangable with other Servoy developers.

 

To get things started I've added a few functions and statements. Expect expansion on a regular basis.

 


Visual FoxPro


Servoy

$ globals.CONTAINS()
= | == = | ==
^ | ** Math.pow()
% %
? application.output()
_CLIPTEXT application.getClipboardString()
ABS() Math.abs()
ACOPY() array.slice
ACOS() Math.acos()
ADDBS() globals.ADDBS()
ADIR() plugins.file.getFolderContents()
ALEN() array.length
ALLTRIM() utils.stringTrim()
AND &&
APRINTERS() application.getPrinters()
ASC() string.charCodeAt()
ASCAN() array.indexOf
ASIN() Math.asin()
ASORT() array.sort
AT() string.indexOf()
ATAN() Math.atan()
ATC() string.toLowerCase().indexOf()
BETWEEN() globals.BETWEEN()
CANCEL application.exit()
CDOW() globals.CDOW()
CEILING() Math.ceil()
CHR() utils.getUnicodeCharacter()
CHRTRAN() globals.CHRTRAN()
CMONTH() globals.CMONTH()
COPY FILE plugins.file.copyFile()
CTOD() globals.CTOD()
CURDIR() plugins.file.getHomeDirectory()
DATE() new Date()
DATETIME() new Date()
DAY() date.getDate()
DELETE FILE plugins.file.deleteFile()
DIMENSION new Array()
DIRECTORY() plugins.file()
DO CASE...ENDCASE switch
DO FORM application.showForm()
DO WHILE...ENDDO while
DOW() date.getDay()
DTOC() globals.DTOC()
DTOS() globals.DTOS()
EMPTY() globals.EMPTY()
ERASE plugins.file.deleteFile()
EVALUATE() eval()
EXIT break
EXP() Math.exp()
FILE() plugins.file()
FILETOSTR() plugins.file.exists()
FLOOR() Math.floor()
FOR...ENDFOR | FOR...NEXT for
FOR EACH...ENDFOR array.ForEach()
GETCOLOR() application.showColorChooser()
GETDIR() plugins.file.showDirectorySelectDialog()
GETFILE() plugins.file.showFileOpenDialog()
GETFONT() application.showFontChooser()
GETWORDCOUNT() utils.stringWordCount()
GETWORDNUM() utils.stringMiddleWords()
GO BOTTOM controller.setSelectedIndex(n);
GO TOP controller.setSelectedIndex(1);
GOMONTH() date.setMonth()
GOTO controller.setSelectedIndex(n);
HOME() plugins.file.getHomeDirectory()
HOUR() date.getHours()
IF...ENDIF if-else
ID() globals.ID()
IIF() if-else
INLIST() globals.INLIST()
INPUTBOX() plugins.dialogs.showInputDialog()
INT() globals.INT()
ISALPHA() globals.ISALPHA()
ISDIGIT() globals.ISDIGIT()
ISLOWER() globals.ISLOWER()
ISNULL() ==null
ISUPPER() globals.ISUPPER()
JUSTDRIVE() globals.JUSTDRIVE()
JUSTEXT() globals.JUSTEXT()
JUSTFNAME() globals.JUSTFNAME()
JUSTPATH() globals.JUSTPATH()
JUSTSTEM() globals.JUSTSTEM()
LEFT() utils.stringLeft()
LEN() string.length
LOCK() databaseManager.acquireLock()
LOG() Math.log()
LOWER() string.ToLower()
LTRIM() globals.LTRIM()
MESSAGEBOX() plugins.dialogs.showInfoDialog
MAX() globals.MAX()
MD plugins.file.createFolder()
MIN() globals.MIN()
MINUTE() date.getMinutes()
MKDIR plugins.file.createFolder()
MOD() %
MONTH() date.getMonth()
msg() plugins.dialog.showInfoDialog()
NOT !
NVL() globals.NVL()
OR ||
OCCURS() utils.stringPatternCount()
OS() application.getOSName()
PADL() globals.PADL()
PADR() globals.PADR()
PARAMETERS() arguments.length
PCOUNT() arguments.length
PI() Math.PI
POW() Math.pow()
PROPER() utils.stringInitCap()
PI() Math.PI
PUTFILE() plugins.file.showFileSaveDialog()
QUARTER() globals.QUARTER()
QUIT application.exit()
RAT() string.lastIndexOf()
RAND() Math.random()
RD plugins.file.deleteFolder()
RECCOUNT() foundset.getSize()
RENAME (to another folder) plugins.file.moveFile()
RENAME (in the same folder) plugins.file.renameFile()
REPLACE foundset.getRecord()
REPLICATE() globals.REPLICATE()
RLOCK() databaseManager.acquireLock()
RIGHT() utils.stringRight()
RMDIR plugins.file.deleteFolder()
ROUND() Math.round()
RTRIM() globals.RTRIM()
RUN() application.executeProgram()
SCAN...ENDSCAN while()
SEC() date.getSeconds()
SECONDS() globals.SECONDS()
SET MESSAGE TO application.setStatusText()
SKIP controller.setSelectedIndex(controller.getSelectedIndex()+1);
SPACE() globals.SPACE()
SQRT() Math.sqrt()
STR() utils.numberFormat()
STREXTRACT() globals.STREXTRACT()
STRTOFILE() plugins.file.appendToTXTFile()
STRTRAN() utils.stringReplace()
STUFF() globals.STUFF()
SUBSTR() string.substr()
SYS(0) globals.SYS(0)
SYS(2) globals.SECONDS()
SYS(3) plugins.file.createTempFile()
SYSMETRIC(1|2) application.getScreenHeight() | application.getScreenWidth()
Thisform forms.frmFormName
TIME() date.toLocaleTimeString()
TRANSFORM() globals.TRANSFORM()
TYPE() typeof()
UPPER() string.ToUpper()
VAL() utils.stringToNumber()
VARTYPE() typeof()
VERSION() application.getVersion()
WEEK() globals.WEEK()

 

 

External resources:

 

vfp plugin

 

ServoyWorld 2012 pics

 

Official Servoy website

 

Ken Levy on Servoy

 

Servoy info

 

Servoy Forum

 

Servoy Documentation

 

VisualFoxpro.com © 2010-2012 • All rights reserved • Contact: info@visualfoxpro.com