Centura Builder Function Reference
Centura Builder Function Reference
Centura Builder Function Reference
Referencia de funciones
20-6202-0000
Marcas comerciales
Centura, centura Builder, centura Ranger, Centura Team Developer, el logotipo de Centura, Gupta, el logotipo de
Gupta, Gupta Powered, el logotipo de Gupta Powered, Fast Facts, Quest, QuickObjects, SQL / API, SQLBase,
SQLBase Ranger, SQLConsole, SQLGateway, sqlhost, SQLNetwork, SQLRouter, SQLTalk, y Administrador de
objetos del equipo son marcas registradas de Gupta Corporation y pueden estar registradas en los Estados
Unidos de América y / u otros países. SQLWindows es una marca registrada y TeamWindows, ReportWindows y
EditWindows son marcas comerciales de uso exclusivo y con licencia de Centura Software Corporation.
Microsoft, Windows 32, Windows, Windows NT y Visual Basic son marcas comerciales registradas o marcas
comerciales de Microsoft Corporation en los Estados Unidos de América y / u otros países.
SApplication Builder es una marca comercial de Rosbach equipo de consultoría. Java es una marca
Todos los demás productos o servicios aquí mencionados son marcas registradas de sus respectivos
dueños.
Derechos de autor
Derechos de autor • 1996 por Centura Software Corporation. Todos los derechos reservados.
Centura Buildern Referencia de funciones
20-6202-0000
de febrero de de 1996
Centura Generador de Referencia de funciones
Contenido
Prefacio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
. . . . . . . . . . . . . . . . . . . . . . . 2-2 SalAppEnable. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 2-4 SalArrayGetLowerBound. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 2-7 SalArrayMin. . . . . . . . . . . . . . . . . . . . . . . . . . .
SalArraySum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
. . . . . . . . . . . . . . . . . . . . . . . . 2-9 SalClearField. . . . . . . . . . . . . . . . . . . . . . . . . .
SalColorGet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
. . . . . . . . . . . . . . . . . . . . . . 2-12 SalColorToRGB. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . 2-15 SalCreateWindow. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 2-18 SalCursorSetFile. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . 2-19
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30 SalDDERequest. . . . . . . . . . . . . . . . . . . . . . . . . . . .
SalNumberMin. . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-111
. . . . . . . . . . . . . . . . . . . . . . . . . . 2-145 SalSendMsgToChildren. . . . . . . . . . . . . . . . . . . . .
2-145
SalSendValidateMsg. . . . . . . . . . . . . . . . . . . . . . . . 2-146 SalSetDefButton. . . . . . . . . . . . . . . . .
SalStrScan. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-161
. . . . 2-178
. . . . . . . . . . . . . . . . . . . . . . . . . 2-188
SalTblQuerySplitWindow. . . . . . . . . . . . . . . . . . . . 2-188
SalTblQueryTableFlags. . . . . . . . . . . . . . . . . . . . . 2-189
. . . . . . . . . . . . . . . . . . . . . . . . . . . 2-189 SalTblScroll. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . 2-190 SalTblSetCellTextColor. . . . . . . . . . . . . . . . . .
SalTblSetColumnPos. . . . . . . . . . . . . . . . . . . . . . . 2-191
SalTblSetColumnText. . . . . . . . . . . . . . . . . . . . . . 2-192
SalTblSetColumnTitle. . . . . . . . . . . . . . . . . . . . . . 2-192
SalTblSetColumnWidth. . . . . . . . . . . . . . . . . . . . . 2-192
SqlContextClear. . . . . . . . . . . . . . . . . . . . . . . . . . . 2-208
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-225 SqlSetInMessage. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . 2-245
. . . . . . . . . . . . . . . . . . . . . . 2-264
. . . . . . . . . . . . . . . . . . . . . . . . . . 2-297 VisMessageFreeButton. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . 2-320 VisWinGetText. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . 2-322 VisWinIsRequiredFieldNull. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 2-324 VisWinLoadAccelerator. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . 2-326 VisWinSetMeter. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 2-328 VisWinSetTabOrder. . . . . . . . . . . . . . . . . . .
Prefacio
• Audiencia
• convenciones tipográficas
Audiencia
Este manual es una guía avanzada para programadores que crean aplicaciones complejas y
sofisticadas utilizando el Generador de Centura.
convenciones tipográficas
Antes de empezar a usar el manual, es importante entender las convenciones tipográficas que utilizamos
en este manual:
negrita tipo Los elementos de menú, botones pulsadores, y nombres de campo. Cosas que se
seleccione. Las teclas del teclado que presione.
itálico tipo Los nombres de los libros y publicaciones. Los marcadores de posición para los
artículos que deberán entregar, tales como nombres de archivo. Por ejemplo, cuando
el manual dice que escribir discos compactos nombre del directorio escribe las letras
tipo de mensajería Comandos o código que debe introducir a través del teclado exactamente
como se muestran.
Nota: Utilizamos esta Nota: convención para llamar su atención hacia información especial.
Ayuda en línea de Centura. Se trata de un amplio sistema de ayuda en línea sensible al contexto. La ayuda en línea ofrece una
forma rápida de encontrar información sobre temas que incluyen elementos de menú, funciones, mensajes y objetos.
Red mundial. En el sitio Web de Centura Software Corporation contiene una gran cantidad de información
sobre los socios, productos y usuarios de Centura Software Corporation. La dirección URL es
http://www.centurasoft.com.
Guía del usuario de Windows. Consulte este manual para obtener más información sobre el Microsoft
sistema operativo Windows.
Capítulo 1
Tablas de función
centura Builder
Funciones Centura
SalAbort SalAppDisable
SalAppEnable SalAppFind
SalArrayAvg SalArrayDimCount
SalArrayGetLowerBound
SalArrayGetUpperBound
SalArrayIsEmpty SalArrayMax
SalArrayMin
SalArraySetUpperBound
SalArraySum
SalBringWindowToTop
SalCenterWindow SalClearField
SalColorFromRGB SalColorGet
SalColorGetSysColor
SalColorSet SalColorToRGB
SalCompileAndEvaluate
SalContextBreak
SalContextCurrent
SalCreateWindow
SalCursorClear SalCursorSet
SalCursorSetFile
SalCursorSetString
SalDateConstruct
SalDateCurrent SalDateDay
SalDateHour SalDateMinute
SalDateMonth
SalDateMonthBegin
SalDateQuarter
SalDateQuarterBegin
SalDateSecond SalDateToStr
SalDateWeekBegin
SalDateWeekday SalDateYear
SalDateYearBegin
SalDDEAddAtom SalDDEAlloc
SalDDEDeleteAtom
SalDDEExtract
SalDDEExtractCmd
SalDDEExtractDataText
SalDDEExtractOptions
SalDDEFindAtom SalDDEFree
SalDDEGetAtomName
SalDDEGetExecuteString
SalDDEPost SalDDERequest
SalDDESend SalDDESendAll
SalDDESendExecute
SalDDESendToClient
SalDDESetCmd
SalDDESetDataText
SalDDESetOptions
SalDDEStartServer
SalDDEStartSession
SalDDEStopServer
SalDDEStopSession
SalDestroyWindow
SalDisableWindow
SalDisableWindowAndLabel
SalDlgChooseColor
SalDlgChooseFont SalDlgOpenFile
SalDlgSaveFile
SalDragDropDisableDrop
SalDragDropEnableDrop
SalDragDropGetSource
SalDragDropGetTarget
SalDragDropStart
SalDragDropStop
SalDrawMenuBar
SalDropFilesAcceptFiles
SalDropFilesQueryFiles
SalDropFilesQueryPoint
SalEditCanCopyTo SalEditCanCut
SalEditCanPaste
SalEditCanPasteFrom
SalEditCanUndo SalEditClear
SalEditCopy SalEditCopyString
SalEditCopyTo SalEditCut
SalEditPaste SalEditPasteFrom
SalEditPasteString SalEditUndo
SalEnableWindow
SalEnableWindowAndLabel
SalEndDialog SalFileClose
SalFileCopy
SalFileCreateDirectory
SalFileGetC SalFileGetChar
SalFileGetCurrentDirectory
SalFileGetDateTime
SalFileGetDrive SalFileGetStr
SalFileOpen SalFileOpenExt
SalFilePutC SalFilePutChar
SalFilePutStr SalFileRead
SalFileRemoveDirectory
SalFileSeek
SalFileSetCurrentDirectory
SalFileSetDateTime
SalFileSetDrive SalFileTell
SalFileWrite SalFmtFieldToStr
SalFmtFormatDateTime
SalFmtFormatNumber
SalFmtGetFormat
SalFmtGetInputMask
SalFmtGetPicture
SalFmtIsValidField
SalFmtIsValidInputMask
SalFmtIsValidPicture
SalFmtKeepMask
SalFmtSetFormat
SalFmtSetInputMask
SalFmtSetPicture
SalFmtStrToField
SalFmtUnmaskInput
SalFmtValidateField
SalFontGet SalFontGetNames
SalFontGetSizes SalFontSet
SalFormGetParmNum
SalFormUnitsToPixels
SalGetDataType
SalGetDefButton
SalGetFirstChild SalGetFocus
SalGetItemName
SalGetMaxDataLength
SalGetNextChild
SalGetProfileInt
SalGetProfileString
SalGetType SalGetVersion
SalGetWindowLabelText
SalGetWindowLoc
SalGetWindowSize
SalGetWindowState
SalGetWindowText
SalHideWindow
SalHideWindowAndLabel
SalHStringToNumber
SalInvalidateWindow
SalIsButtonChecked SalIsNull
SalIsValidDateTime
SalIsValidDecimal
SalIsValidInteger
SalIsValidNumber
SalIsWindowEnabled
SalIsWindowVisible
SalListAdd SalListClear
SalListDelete SalListFiles
SalListGetMultiSelect
SalListInsert SalListPopulate
SalListQueryCount
SalListQueryFile
SalListQueryMultiCount
SalListQuerySelection
SalListQueryState
SalListQueryText
SalListQueryTextLength
SalListQueryTextX
SalListRedraw
SalListSelectString
SalListSetMultiSelect
SalListSetSelect
SalListSetTabs SalLoadApp
SalLoadAppAndWait
SalMapEnterToTab
SalMDIArrangeIcons
SalMDICascade SalMDITile
SalMessageBeep
SalMessageBox
SalModalDialog
SalModalDialogFromStr
SalMoveWindow
SalNumberAbs
SalNumberArcCos
SalNumberArcSin
SalNumberArcTan
SalNumberArcTan2
SalNumberCos
SalNumberCosH
SalNumberExponent
SalNumberHigh
SalNumberHypot
SalNumberLog
SalNumberLogBase10
SalNumberLow
SalNumberMax
SalNumberMin
SalNumberMod SalNumberPi
SalNumberPower
SalNumberRandInit
SalNumberRandom
SalNumberRound
SalNumberSin
SalNumberSinH
SalNumberSqrt
SalNumberTan
SalNumberTanH
SalNumberToChar
SalNumberToHString
SalNumberToStr
SalNumberToStrX
SalNumberToWindowHandle
SalNumberTruncate
SalParentWindow SalPicClear
SalPicGetDescription
SalPicGetString SalPicSet
SalPicSetFile SalPicSetFit
SalPicSetString
SalPixelsToFormUnits
SalPostMsg SalPrtExtractRect
SalPrtGetDefault
SalPrtGetParmNum
SalPrtPrintForm
SalPrtSetDefault
SalPrtSetParmDefaults
SalPrtSetParmNum
SalPrtSetup
SalQueryFieldEdit
SalQuit
SalReportClose SalReportCmd
SalReportCreate
SalReportDlgOptions
SalReportGetDateTimeVar
SalReportGetNumberVar
SalReportGetObjectVar
SalReportGetStringVar
SalReportPrint
SalReportPrintToFile
SalReportReset
SalReportSetDateTimeVar
SalReportSetNumberVar
SalReportSetObjectVar
SalReportSetStringVar
SalReportTableCreate
SalReportTablePrint
SalReportTableView SalReportView
SalScrollGetPos SalScrollGetRange
SalScrollSetPos SalScrollSetRange
SalSendClassMessage
SalSendClassMessageNamed
SalSendMsg
SalSendMsgToChildren
SalSendValidateMsg
SalSetDefButton
SalSetFieldEdit SalSetFocus
SalSetMaxDataLength
SalSetProfileString
SalSetWindowLabelText
SalSetWindowLoc
SalSetWindowSize
SalSetWindowText
SalShowWindow
SalShowWindowAndLabel
SalStatusGetText
SalStatusSetText
SalStatusSetVisible
SalStrCompress
SalStrFirstC
SalStrGetBufferLength
SalStrIsValidCurrency
SalStrIsValidDateTime
SalStrIsValidNumber
SalStrLeft SalStrLeftX
SalStrLength SalStrLop
SalStrLower SalStrLowerX
SalStrMid SalStrMidX
SalStrProper SalStrProperX
SalStrRepeat SalStrRepeatX
SalStrReplace
SalStrReplaceX SalStrRight
SalStrRightX SalStrScan
SalStrSetBufferLength
SalStrToDate SalStrTokenize
SalStrToNumber SalStrTrim
SalStrTrimX SalStrUncompress
SalStrUpper SalStrUpperX
SalTBarSetVisible
SalTblAnyRows
SalTblClearSelection
SalTblColumnAverage
SalTblColumnSum
SalTblCopyRows
SalTblCreateColumn
SalTblDefineRowHeader
SalTblDefineSplitWindow
SalTblDeleteRow
SalTblDeleteSelected
SalTblDestroyColumns
SalTblDoDeletes SalTblDoInserts
SalTblDoUpdates
SalTblFetchRow
SalTblFindNextRow
SalTblFindPrevRow
SalTblGetColumnText
SalTblGetColumnTitle
SalTblGetColumnWindow
SalTblInsertRow SalTblKillEdit
SalTblKillFocus
SalTblPasteRows SalTblPopulate
SalTblQueryColumnFlags
SalTblQueryColumnID
SalTblQueryColumnPos
SalTblQueryColumnWidth
SalTblQueryContext
SalTblQueryFocus
SalTblQueryLockedColumns
SalTblQueryRowFlags
SalTblQueryRowHeader
SalTblQueryScroll
SalTblQuerySplitWindow
SalTblQueryTableFlags
SalTblQueryVisibleRange
SalTblReset SalTblScroll
SalTblSetCellTextColor
SalTblSetColumnFlags
SalTblSetColumnPos
SalTblSetColumnText
SalTblSetColumnTitle
SalTblSetColumnWidth
SalTblSetContext
SalTblSetFlagsAnyRows
SalTblSetFocusCell
SalTblSetFocusRow
SalTblSetLockedColumns
SalTblSetRange SalTblSetRow
SalTblSetRowFlags SalTblSetTableFlags
SalTblSortRows SalTimerKill SalTimerSet
SalTrackPopupMenu SalUpdateWindow
SalValidateSet SalWaitCursor
SalWindowGetProperty
SalWindowHandleToNumber
SalWindowIsDerivedFromClass
SalWinHelp SalYieldEnable
SalYieldQueryState
SalYieldStartMessages
SalYieldStopMessages
SqlClearImmediate SQLClose
SQLCommit SQLCONNECT
SqlContextClear SqlContextSet
SqlContextSetToForm
SqlDirectoryByName SQLDisconnect
SqlDropStoredCmd SqlError SqlErrorText
SQLExecute SqlExecutionPlan SqlExists
SqlExtractArgs SqlFetchNext
SqlFetchPrevious SqlFetchRow
SqlGetError SqlGetErrorPosition
SqlGetErrorText SqlGetErrorTextX
SqlGetModifiedRows SqlGetParameter
SqlGetParameterAll
SqlGetResultSetCount
SqlGetRollbackFlag
SqlImmediate
SqlImmediateContext
SQLOpen
SqlPLSQLCommand
SQLPREPARE
SqlPrepareAndExecute
SQLRetrieve SqlSetInMessage
SqlSetIsolationLevel
SqlSetLockTimeout
SqlSetLongBindDatatype
SqlSetOutMessage
SqlSetParameter
SqlSetParameterAll
SqlSetResultSet SqlStore
SqlVarSetup VisArrayAppend
VisArrayCopy
VisArrayDeleteItem
VisArrayFillDateTime
VisArrayFillNumber
VisArrayFillString
VisArrayFindDateTime
VisArrayFindNumber
VisArrayFindString
VisArrayInsertItem VisArraySort
VisDebugAssert
VisDebugBeginTime
VisDebugEndTime
VisDebugGetFlags
VisDebugSetFlags
VisDebugSetLevel
VisDebugSetTime
VisDebugString
VisDosBuildFullName
VisDosEnumDirInfo
VisDosEnumDirs
VisDosEnumDrives
VisDosEnumFileInfo
VisDosEnumFiles
VisDosEnumNetConnections
VisDosEnumPath
VisDosEnumsShortDirInfo
VisDosEnumsShortDirs
VisDosEnumsShortFileInfo
VisDosEnumsShortFiles VisDosExist
VisDosGetCurDir
VisDosGetDriveSize
VisDosGetDriveType
VisDosGetEnvString VisDosGetFlags
VisDosGetNetName
VisDosGetVersion
VisDosGetVolumeLabel
VisDosIsParent VisDosMakeAllDir
VisDosMakePath VisDosNetConnect
VisDosNetDisconnect
VisDosSetFlags
VisDosSetVolumeLabel
VisDosSplitPath VisErrorRecovery
VisFileAppend VisFileClose
VisFileCopy VisFileCreateTemp
VisFileDelete VisFileExpand
VisFileFind VisFileGetAttribute
VisFileGetSize VisFileGetType
VisFileOpen VisFileRead
VisFileReadString VisFileRename
VisFileSeek VisFileSetAttribute
VisFileSetDateTime VisFileTell
VisFileWrite VisFileWriteString
VisFontEnum VisFontFree
VisFontGet VisFontLoad
VisGetCopyright VisGetKeyState
VisGetSystemMetrics
VisGetVersion VisGetWinFlags
VisGetWinVersion
VisListAddValue
VisListArrayPopulate
VisListArrayPopulateValue
VisListClearSelection
VisListDeleteSelected
VisListFindString VisListFindValue
VisListGetDropdownState
VisListGetFocusIndex
VisListGetVisibleRange
VisListInsertValue
VisListIsMultiSelect
VisListLoadOutline
VisListLoadOutlineFile
VisListSaveOutline VisListScroll
VisListSetDropdownState
VisListSetFocusIndex
VisListSetScrollWidth
VisMenuGetPopupHandle
VisMenuGetSystemHandle
VisMenuGetText VisMenuInsert
VisMenuInsertFont
VisMenuInsertPicture
VisMenuIsChecked
VisMenuIsEnabled
VisMenuSetFont
VisMenuSetPicture
VisMenuSetText VisMenuUncheck
VisMessageBox
VisMessageFreeButton
VisMessageLoadButton
VisMessageSetBkgdColor
VisNumberBitClear VisNumberBitSet
VisNumberChoose
VisNumberHighByte
VisNumberLowByte
VisNumberMakeLong VisPicFree
VisPicLoad VisProfileDelete
VisProfileEnumStrings
VisSendMsgString VisStrChoose
VisStrExpand VisStrFind
VisStrFreeTable VisStrLeftTrim
VisStrLoadTable VisStrPad
VisStrProper VisStrRightTrim
VisStrScanReverse VisStrSubstitute
VisStrTrim VisTblAllRows
VisTblAutoSizeColumn
VisTblClearColumnSelection
VisTblFindDateTime
VisTblFindNumber VisTblFindString
VisTblGetCell VisTblGetColumnTitle
VisTblSetRowColor
VisTblSetRowPicture VisWaitCursor
VisWinGetFlags
VisWinClearAllEditFlags
VisWinClearAllFields
VisWinEnumProps
VisWinFreeAccelerator
VisWinGetHandle VisWinGetProp
VisWinGetStyle VisWinGetText
VisWinIsChild VisWinIsMaximized
VisWinIsMinimized
VisWinIsRequiredFieldNull
VisWinIsRestored
VisWinIsWindow
VisWinLoadAccelerator
VisWinMove VisWinRemoveProp
VisWinSetFlags VisWinSetMeter
VisWinSetProp VisWinSetStyle
VisWinSetTabOrder VisWinShow
Funciones de matrices
Estas funciones administrar matrices y valores de cómputo.
VisArrayFillDateTime Rellena una matriz de fecha / hora con un valor de fecha / hora
especificada.
VisFontEnum Obtiene los nombres de las fuentes y tipos (impresora, cierto tipo, etc.).
VisTblSetRowColor Establece el color del texto para toda una fila de una ventana de la tabla.
Funciones de fecha
Estas funciones manipulan los valores de fecha / hora.
SalDateQuarterBegin Obtiene la fecha del primer día de la cuarta parte de una fecha
determinada.
SalDateYearBegin Obtiene la fecha del primer día del año de una fecha determinada.
Funciones DDE
Estas funciones soportan los protocolos de Microsoft para el intercambio dinámico de datos (DDE). DDE le permite
intercambiar datos con otras aplicaciones de Windows que también soportan los protocolos de Microsoft.
SalDDEStopServer Señales de clientes que el servidor quiere poner fin a las operaciones
del servidor DDE.
Funciones de test
Estas funciones ayudan a depurar su aplicación.
VisDosEnumsShortFiles Recupera todos los nombres largos y cortos de archivo para un directorio
dado en una matriz de Centura.
VisDosNetDisconnect
tiempo Cancela
de ejecución, así como arrastrar y soltar entre los objetos de una VisDosIsParent
la aplicación. conexión de red.
Funciones de edición
así, estas funciones permitirá a los elementos del menú Editar. SalDropFilesQueryPoint
La mayoría de estas funciones proporcionan capacidades de edición de texto. Utilizarlos para los campos que un usuario edita.
que se utiliza para cortar y pegar entre campos de texto. Otras funciones de identificar si un usuario ha seleccionado los datos y si es
Microsoft Windows mantiene tanto una memoria intermedia de anulación que almacena las ediciones anteriores y un buffer de pasta
SalEditClear Elimina los datos seleccionados a partir del campo de datos, campo
de varias líneas, columna de ventana de la tabla, o imagen con el
enfoque.
• SalDisableWindowAndLabel
• SalHideWindowAndLabel
• SalShowWindowAndLabel
Otras dos funciones que puede utilizar con el texto de fondo se explican a continuación.
hWnd identifica la ventana que tiene una etiqueta de devolverlo en el sText recibir cadena. Si esta función falla,
se devuelve 0. Los parámetros son similares a SalGetWindowText.
hWnd identifica la ventana que tiene una etiqueta. Si esta función falla, se devuelve FALSO. Los parámetros son
Funciones MDI
Estas funciones soportan MDI (interfaz de múltiples documentos) las ventanas.
Funciones de mensajes
Utilizar estas funciones para publicar y enviar mensajes a los objetos.
VisMessageBox
VisMessageSetBkgdColor Establece el color de fondo para una
VisMessageBox caja de diálogo.
Funciones varias
Estas funciones realizan tareas del sistema misceláneos desde una aplicación de Centura.
VisWinClearAllEditFlags Borra las banderas campo de edición para cada campo de datos o el
campo de texto de varias líneas de una ventana padre.
Funciones numéricas
Estas funciones realizan cálculos matemáticos.
Funciones de imagen
Estas funciones manipular el contenido de una imagen.
Funciones de impresión
Estas funciones le permiten controlar la impresión.
funciones de informe
Centura permite generar informes previamente diseñados con ReportWindows. Mediante el uso de las funciones enumeradas
ReportWindows en la siguiente sección, se puede crear, visualizar, formatear e imprimir un informe, así como obtener y variables
de informes establecidos.
coherente. SalReportReset
SalReportTablePrint Se imprime un informe creado a partir de una ventana de la tabla.
proporcionando conectividad
Nombre de laafunción
un número cada vez mayor de bases de datos, estas funciones proporcionan una interfaz
Descripción
Funciones SQL
La mayoría de las funciones de base de datos SQL son independientes. Como Centura Software Corporation continúa
SqlGetErrorText y SqlGetErrorTextX Obtiene el texto del mensaje para una serie de errores de SQL.
VisStrScanReverse Analiza una cadena para una subcadena especificada desde el último
carácter de la primera.
SalTblDeleteSelected Se aplica una instrucción DELETE para todas las filas seleccionadas.
SalTblDoDeletes Se aplica una instrucción DELETE para todas las filas con ciertos
indicadores establecidos.
SalTblFindNextRow Exploraciones hacia adelante en busca de una fila que tiene ciertos
indicadores establecidos.
SalTblFindPrevRow Exploraciones hacia atrás en busca de una fila que tiene ciertos
indicadores establecidos.
VisTblAutoSizeColumn Realiza una mejor ajuste de los contenidos de la pantalla de una columna
específica.
VisWinSetProp Añade una nueva entrada en la lista propiedad o cambia una entrada de
lista de propiedades existente para una ventana especificada.
Capitulo 2
Funciones centura
Builder
Esta es una lista alfabética de las funciones Centura Builder acompañados de información detallada acerca del
propósito de cada función, sus parámetros y el valor de retorno, y un ejemplo.
• Sintaxis
• Descripción
• parámetros
• valor de retorno
• Ver también
• Ejemplo
SalAbort
Sintaxis Bok = SalAbort ( nExitCode)
Descripción Detiene el procesamiento de la acción de menú actual, acción de los mensajes, o la acción de la aplicación. Utilice
SalAbort cuando se desea terminar la secuencia de llamadas actual sin devolver un estado.
Por ejemplo, si la aplicación es de varias capas en las llamadas a funciones internas y se produce un error, SalAbort termina la
secuencia de llamada de corriente de las funciones y las hojas de la aplicación en el estado en que estaba antes de la primera
llamada a la función de esa secuencia.
parámetros nExitCode Recibe Número. El estado de la salida realizada por SalAbort. Centura ignora este
parámetro como entrada.
SalAppDisable
Sintaxis Bok = SalAppDisable ( )
Descripción Desactiva entrada para todas las aplicaciones abiertas. Utilice SalAppDisable y SalAppEnable cuando hay varias
aplicaciones que se ejecutan simultáneamente y que quieren controlar la aplicación que recibe la entrada del usuario.
SalAppEnable ()
Descripción Activa la entrada a todas las aplicaciones abiertas que fueron desactivados por SalAppDisable. Utilice
SalAppDisable y SalAppEnable cuando hay varias aplicaciones que se ejecutan simultáneamente y que quieren
controlar la aplicación que recibe la entrada del usuario.
Valor de retorno Bok es TRUE si la función tiene éxito y FALSE si no lo hizo llamar previamente
SalAppDisable.
()
SalAppFind
Sintaxis CVent = SalAppFind ( strAppName, bActivate)
Descripción Encuentra una ventana de nivel superior visible de la aplicación que se especifica y devuelve su identificador de ventana.
SalAppFind busca primero para ejecutar sesiones de aplicaciones Centura y luego para ejecutar sesiones de
otras aplicaciones de Windows.
Si se especifica el nombre de la aplicación que llama en SalAppFind, Centura sólo puede encontrar otra instancia en
ejecución de la misma. Puede utilizar esta función para evitar que más de una instancia de una aplicación en ejecución.
Si hay varias instancias de una sola aplicación, SalAppFind encuentra y devuelve el identificador de ventana de la
primera instancia que encuentra.
Si una aplicación tiene múltiples ventanas de nivel superior, SalAppFind devuelve el identificador de la primera ventana de
nivel superior que encuentra. Llamando SalAppFind varias veces no siempre devuelve el mango de la misma ventana.
parámetros strAppName Cuerda. El nombre de la aplicación sin la extensión. Para aplicaciones de Centura,
especifique el nombre de * .EXE. Para otras aplicaciones de Windows, especifique el
valor dado en la instrucción NAME en el archivo * .def de la aplicación.
llamada SalQuit ()
SalArrayAvg
Sintaxis NAVG = SalArrayAvg ( nArrayNum)
SalArraySetUpperBound
SalArraySum
Ejemplo en SAM_Create
Establecer dfAvg = SalArrayAvg ( nArrayNum)
SalArrayDimCount
Sintaxis Bok = SalArrayDimCount ( aMatriz, Ndim)
SalArraySetUpperBound
(AMatriz, Ndim)
Si Ndim = 0
SalArrayGetLowerBound
Sintaxis Bok = SalArrayGetLowerBound ( aMatriz, Ndim, NBOUND)
SalArraySetUpperBound
SalArraySum
(AMatriz, NBOUND)
SalArrayGetUpperBound
Sintaxis Bok = SalArrayGetUpperBound ( aMatriz, Ndim, NBOUND)
SalArraySetUpperBound
SalArraySum
(AMatriz, NBOUND)
SalArrayIsEmpty
Sintaxis bDatos = SalArrayIsEmpty ( aMatriz)
Valor de retorno bDatos es TRUE si la matriz no contiene datos y FALSE si se tiene datos.
SalArraySetUpperBound
SalArraySum
Ejemplo En SAM_Click Si
No SalArrayIsEmpty (AMatriz)
Llamada ...
SalArraySetUpperBound
SalArraySum
Ejemplo en SAM_Create
Establecer dfMax = SalArrayMax ( nArrayNum)
SalArrayMin
Sintaxis nMin = SalArrayMin ( nArrayNum)
SalArraySetUpperBound
SalArraySum
Ejemplo en SAM_Create
Establecer dfMin = SalArrayMin ( nArrayNum)
SalArraySetUpperBound
Sintaxis Bok = SalArraySetUpperBound ( aMatriz, Ndim, NBOUND)
Cuando se llama a esta función de una dimensión distinta de la primera, Centura debe copiar la mayor parte de los datos de la
matriz. Puede haber un costo de rendimiento cuando se llama a esta función de cualquier dimensión, pero la primera.
NBOUND Número. valor límite superior. Especificar -1 para restablecer una matriz dinámica a cero
elementos. Especificar AC_Dynamic para cambiar una matriz estática a una matriz
dinámica. (Se puede hacer sólo la primera dimensión de una dinámica matriz.)
(AMatriz, 1, 5)
SalArraySum
Sintaxis NSUM = SalArraySum ( nArrayNum)
Ejemplo en SAM_Create
Establecer dfSum = SalArraySum ( nArrayNum)
SalBringWindowToTop
Sintaxis Bok = SalBringWindowToTop ( hWndToExpose)
Descripción Trae una ventana a la parte superior de todas las ventanas superpuestas.
parámetros hWndToExpose Identificador de ventana. El mango (o nombre) de la ventana para acceder a la parte superior.
Ejemplo Si (hWndCustomer)
Llamada SalBringWindowToTop (HWndCustomer)
SalCenterWindow
Sintaxis Bok = SalCenterWindow ( hWndCenter)
Descripción Centra una ventana. Si la ventana es una ventana de nivel superior, Centura lo centra en el escritorio. Si la ventana es una
ventana secundaria, Centura lo centra en la parte superior de su matriz.
SalClearField
Sintaxis Bok = SalClearField ( hWndFldToClear)
Descripción Borra el valor de un campo de datos, campo de varias líneas, o columna ventana de la tabla.
parámetros hWndFldToClear Identificador de ventana. El mango (o nombre) del campo de datos, campo de varias líneas,
o columna ventana de la tabla para borrar.
SalColorFromRGB
Sintaxis nColor = SalColorFromRGB ( Nred, nGreen, Nblue)
parámetros hWndColored Identificador de ventana. El mango (o nombre) de la ventana cuyo color desea.
nColorIndex Número. El color de una parte de la ventana, representado por una de estas
constantes: COLOR_IndexCellText COLOR_IndexTransparent
COLOR_IndexWindow COLOR_IndexWindowText
Valor de retorno nColor es el color devuelto. Puede ser definida por el usuario o una de la ventana predefinida
COLOR_Magenta)
SalColorGetSysColor
Sintaxis nColor = SalColorGetSysColor ( nColorIndex)
parámetros nColorIndex Número. El color de una parte de la ventana, representado por una de estas
constantes: COLOR_SysWindow COLOR_SysWindowFrame
COLOR_SysWindowText
Valor de retorno nColor es el color devuelto. Puede ser uno de los colores de las ventanas predefinidas
SalColorSet
Sintaxis Bok = SalColorSet ( hWndToSet, nColorIndex, nColor)
parámetros hWndToSet Identificador de ventana. El mango (o nombre) de la ventana cuyo color desea
establecer.
nColorIndex Número. El color de una parte de la ventana, representado por una de estas
constantes: COLOR_IndexCellText COLOR_IndexTransparent
COLOR_IndexWindow COLOR_IndexWindowText
nColor Número. Un valor definido por el usuario, un valor formulado usando SalColorFromRGB, o
cualquiera de los colores de Windows predefinidas. Para desactivar el color transparente,
especifique COLOR_None.
parámetros nColor Número. Un valor definido por el usuario o cualquiera de los colores de la ventana
predefinidos (excluyendo COLOR_Default, COLOR_None, y los tres COLOR_Sys *
constantes).
Nred Recibe número. Un número de 0 a 255 que representa el valor de color rojo.
SalCompileAndEvaluate
Sintaxis nTipo = SalCompileAndEvaluate ( strExpression, nError, nErrorPos, Nreturn, strReturn,
dtReturn, hWndReturn, bInhibitErrors, strContext)
Descripción Evalúa una expresión y devuelve el valor de la expresión en el parámetro recibir apropiada a su tipo de datos.
SalCompileAndEvaluate le permite acceder al valor de una variable cuyo nombre no especifica hasta el tiempo
de ejecución.
strReturn Recibe cadena. Este parámetro se establece si strExpression se evalúa como una cadena.
dtReturn Recibe fecha / hora. Este parámetro se establece si strExpression se evalúa como un
valor de fecha / hora.
Valor de retorno nTipo es igual a uno de los siguientes valores si la función tiene éxito:
EVAL_Date
EVAL_Handle
EVAL_If
EVAL_Number
EVAL_Set
eval_string
EVAL_Template
...
SalContextBreak
Sintaxis strContext = SalContextBreak ( )
Descripción Recupera el contexto de la declaración de la rotura ejecutado más recientemente. Utilice esta función con
SalCompileAndEvaluate.
SalContextCurrent
Sintaxis strContext = SalContextCurrent ( )
SalCreateWindow
Sintaxis hWndCreated = SalCreateWindow ( tWndToCreate, hWndOwner, Parm1,
Parm2, ...)
Descripción Crea cajas modales diálogo, ventanas, ventanas MDI de formularios y ventanas de tabla de nivel superior en tiempo de ejecución.
Esta función acepta una cadena o una plantilla como el primer parámetro. Cuando se pasa una cadena, no se puede pasar
también parámetros de la ventana.
Si especifica un propietario (hWndOwner), la nueva ventana muestra siempre en la parte superior de su propietario, se
cierra cuando su propietario se cierra, y se esconde cuando se minimiza su propietario. SalCreateWindow puede pasar
datos a y desde la ventana que se crea mediante la aceptación de un número variable de parámetros. Los tipos de datos
de estos parámetros deben coincidir con los que se crean los tipos de datos de parámetros de la ventana. Se definen los
parámetros de la ventana en la sección de parámetros de la ventana del esquema de aplicación. Por ejemplo, este código
pasa la variable, nGlobal y el campo de datos, DF1 a la ventana del formulario, frmMain. Antes SAM_Create se envía a
frmMain, su primer parámetro ventana se inicializa con el valor de nGlobal y su parámetro segunda ventana se inicializa
con el valor de DF1.
Puede utilizar parámetros de la ventana para devolver información desde la ventana que se crea mediante el uso de un tipo de
recepción. Sin embargo, puede inicializar recibir parámetros de ventana única con variables. Esto significa que no se puede
pasar un campo de datos o cualquier otro objeto de la ventana a un parámetro ventana que se define como un tipo de
recepción.
Ejemplo en SAM_Click
Si no SalCreateWindow ( frmCustomer, hWndNULL)
... Error...
SalCreateWindowExWithParms
Sintaxis hWndCreated = (SalCreateWindowExWithParms tWndToCreate,
hWndOwner, nLeft, nTop, nWidth, nHeight, nFlags ...)
Descripción Crea un formulario, cuadro de diálogo o ventana de la tabla como un hijo de otra forma o cuadro de diálogo en tiempo de ejecución.
Esta función acepta una cadena o una plantilla como el primer parámetro. Cuando se pasa una cadena, no se puede pasar
también parámetros de la ventana.
Si especifica un propietario (hWndOwner), la nueva ventana muestra siempre en la parte superior de su propietario, se cierra
cuando su propietario se cierra, y se esconde cuando se minimiza su propietario. SalCreateWindowExWithParms pueden pasar
datos a y desde la ventana que se crea mediante la aceptación de un número variable de parámetros. Los tipos de datos de
estos parámetros deben coincidir con los que se crean los tipos de datos de parámetros de la ventana. Se definen los
parámetros de la ventana en la sección de parámetros de la ventana del esquema de aplicación.
Por ejemplo, este código pasa la variable, nGlobal y el campo de datos, DF1 a la ventana del formulario,
frmMain. Antes SAM_Create se envía a frmMain, su primer parámetro ventana se inicializa con el valor de
nGlobal y su parámetro segunda ventana se inicializa con el valor de DF1.
Puede utilizar parámetros de la ventana para devolver información desde la ventana que se crea mediante el uso de un tipo de
recepción. Sin embargo, puede inicializar recibir parámetros de ventana única con variables. Esto significa que no se puede
pasar un campo de datos o cualquier otro objeto de la ventana a un parámetro ventana que se define como un tipo de
recepción.
parámetros tWndToCreate Plantilla o cadena. El nombre de la ventana para crear. Nota: Si especifica un valor
PARM2, ...).
Ejemplo en SAM_Click
Si no SalCreateWindowExWithParms (FrmCustomer, hWndNULL,
nLeft, nTop, nWidth, nHeight)
... Error...
SalCursorClear
Sintaxis Bok = SalCursorClear ( hWnd, nTipo)
(FrmMain, Cursor_Windows)
SalCursorSet
Sintaxis Bok = SalCursorSet ( hWnd, tResource, nTipo)
CURSOR_UpArrow CURSOR_Wait
SalCursorSetFile
Sintaxis Bok = SalCursorSetFile ( hWnd, sFile, nTipo)
Descripción Define un cursor definido por la aplicación de la ventana especificada. Utilice esta función para establecer el cursor desde una imagen
almacenada en un archivo.
CURSOR_DisableDrop
CURSOR_DragDrop
CURSOR_Window
SalCursorSetString
Sintaxis Bok = SalCursorSetString ( hWnd, sBuffer, nTipo)
SalDateConstruct
Sintaxis dtDate = SalDateConstruct ( nYear, nMonth, Nday, Nhour, nMinute, Nsecond)
Descripción Devuelve la fecha / hora construido a partir de los parámetros Nyear, nMonth, Nday, Nhour, nMinute y
Nsecond.
Si especifica valores de los parámetros no válidos, una construcción fecha inesperado puede resultar.
Nota: Si cualquiera de los valores de los parámetros tiene menos que el número especificado de dígitos, SalDateConstruct almohadillas el
valor resultante con ceros a la izquierda (0). Por ejemplo, si es nYear 92, dtDate comienza con 0092.
SalDateCurrent
Sintaxis dtNow = SalDateCurrent ( )
Para obtener la fecha / hora del sistema del servidor de base de datos, utilice una palabra clave sistema de base de datos
(SYSDATE, SYSTIME o SYSDATETIME) en una instrucción SELECT de SQL.
Ejemplo en SAM_Create
Establecer dfCurrent = SalDateCurrent ()
SalDateDay
Sintaxis nday = SalDateDay ( dtDateTime)
Descripción Devuelve la parte correspondiente al día (1 a 31) de un valor de fecha / hora o devuelve -1 si especifica DATETIME_Null
como parámetro.
SalDateYear
SalDateHour
Sintaxis Nhour = SalDateHour ( dtDateTime)
Descripción Devuelve la parte de horas (0 a 23) de un valor de fecha / hora o devuelve -1 si especifica DATETIME_Null
como parámetro.
SalDateSecond
SalDateMinute
Sintaxis nMinute = SalDateMinute ( dtDateTime)
Descripción Devuelve la porción minutos (0 a 59) de un valor de fecha / hora o devuelve -1 si especifica DATETIME_Null
como parámetro.
SalDateSecond
SalDateMonth
Sintaxis nMonth = SalDateMonth ( dtDateTime)
Descripción Devuelve la parte correspondiente al mes (1 a 12) de un valor de fecha / hora o devuelve -1 si especifica DATETIME_Null
como parámetro.
Funciones relacionadas
SalDateDay
SalDateYear
SalDateMonthBegin
Sintaxis dtMonthBegin = SalDateMonthBegin ( dtDateTime)
Descripción Devuelve la fecha del primer día del mes o vuelve DATETIME_Null si el valor especificado es nulo. Por
ejemplo, si dtDateTime es de 25 de diciembre de 1992 SalDateMonthBegin devuelve 1 de diciembre de.,
1992
Valor de retorno dtMonthBegin es la fecha del primer día del mes de dtDateTime.
SalDateQuarter
Sintaxis nQuarter = SalDateQuarter ( dtDateTime)
Descripción Devuelve el trimestre del año (1 a 4) de un valor de fecha / hora o devuelve -1 si especifica DATETIME_Null como
parámetro.
...
SalDateQuarterBegin
Sintaxis dtQuarterBegin = SalDateQuarterBegin ( dtDateTime)
Descripción Devuelve la fecha del primer día de la cuarta parte de un valor de fecha / hora o vuelve DATETIME_Null si
el valor especificado es nulo.
(SalDateCurrent ()
SalDateSecond
Sintaxis nSeconds = SalDateSecond ( dtDateTime)
Descripción Devuelve la porción segundos (0 a 59) de un valor de fecha / hora o devuelve -1 si especifica DATETIME_Null
como parámetro.
SalDateToStr
Sintaxis nLongitud = SalDateToStr ( dtDateTime, strDate)
Descripción Convierte un valor de fecha / hora para un valor de cadena o devuelve -1 si especifica DATETIME_Null
como parámetro.
SalDateWeekBegin
Sintaxis dtWeekBegin = SalDateWeekBegin ( dtDateTime)
Descripción Devuelve la fecha del lunes anterior o el día actual si es un lunes o vuelve DATETIME_Null si el
valor especificado es nulo.
Valor de retorno dtWeekBegin es la fecha del lunes anterior, o la fecha actual si es lunes.
Descripción Devuelve el día de la semana como un número entre 0 y 6 o devuelve -1 si especifica DATETIME_Null
como parámetro. 0 representa Sábado, 1 representa S D OMINGO, y por lo
en.
Valor de retorno
SalDateYear
Sintaxis nYear = SalDateYear ( dtDateTime)
Descripción Devuelve la parte de año de una fecha o devuelve -1 si especifica DATETIME_Null como parámetro.
SalDateYearBegin
Sintaxis dtYearBegin = SalDateYearBegin ( dtDateTime)
Descripción Devuelve la fecha del primer día del año o vuelve DATETIME_Null si el valor especificado es nulo.
SalDDEAddAtom
Sintaxis nNewAtom = SalDDEAddAtom ( strStringToAdd)
Descripción Añade una cadena a la tabla de átomo global y crea un nuevo átomo de identificar la cadena. Si la cadena de añadir ya se
encuentra en la tabla de átomo, el átomo de recuento de referencia para esa cadena se incrementa en uno.
parámetros strStringToAdd Cuerda. La cadena (255 caracteres o menos) para añadir a la tabla de átomo global.
Valor de retorno Si la función tiene éxito, nNewAtom es el valor de la nueva átomo global. Si la cadena ya existe,
nNewAtom es el valor del átomo existente. De lo contrario, nNewAtom es cero (0).
(NOptions, 0, CF_TEXT)
Conjunto nItem = SalDDEAddAtom (strItem)
nOptions, nItem)
SalDDEAlloc
Sintaxis nMemory = SalDDEAlloc ( )
Valor de retorno nMemory es un identificador de memoria global. Si la función falla, nMemory es cero (0).
Descripción Decrementa el contador de referencia de un átomo. Si el contador de referencias llega a cero (0), Centura
elimina tanto el átomo y su cadena asociada de la tabla de átomo global. Cuando la aplicación termina, llamar a
esta función para cada SalDDEAddAtom exitosa llamada realizada.
Valor de retorno Si la función tiene éxito, nAtomCount es cero (0). Si la función falla, nAtomCount es igual a
nAtomToDelete.
SalDDEExtract
Sintaxis Bok = SalDDEExtract ( nwParam, nlParam, hWndSender, nLowlParam, nHighlParam)
Descripción Extrae identificador de ventana del remitente y los datos en el parámetro lParam a la recepción de un mensaje
de Windows DDE.
SalDDEExtractCmd
Sintaxis Bok = SalDDEExtractCmd ( nCommand, strCommand, nCommandSize)
Descripción Extrae la cadena de comandos que hace referencia la palabra de orden superior de la lParam de un mensaje
WM_DDE_EXECUTE.
SalDDEExtractDataText
Sintaxis Bok = SalDDEExtractDataText ( NDATA, nstatus, strData, nDataSize)
Descripción Extrae los datos referenciados por la palabra de orden inferior de la lParam en un mensaje
WM_DDE_DATA o WM_DDE_Poke.
parámetros NDATA Número. El mango del objeto de memoria que contiene los datos y otra
información.
bits de estado.
SalDDEExtractOptions
Sintaxis Bok = (SalDDEExtractOptions nOptions, nFlags, NFORMAC)
Descripción Extrae identificador de ventana del remitente y los datos en el parámetro lParm de un mensaje de Windows
DDE.
Para más información sobre el DDE, ver el capítulo en el DDE Centura del desarrollador de referencia.
SalDDEFindAtom
Sintaxis Natom = SalDDEFindAtom ( strTopicString)
Descripción Busca en la tabla de átomo global y devuelve el átomo asociado con la cadena dada.
Valor de retorno Natom es el átomo global asociado con strTopicString. Natom es cero (0) si Centura
no encontrar la cadena en la tabla átomo.
SalDDEFree
Sintaxis nManejador = SalDDEFree ( nMemory)
Cuando la aplicación termina, llamar a esta función para cada SalDDEAlloc exitosas llamada realizada.
Valor de retorno nManejador es cero (0) si la función tiene éxito, y es igual al valor de nMemory si
la función falla.
y DDE_fRelease
SalDDEGetAtomName
Sintaxis nAtomSize = SalDDEGetAtomName ( Natom, strAtomName, nStringLength)
Valor de retorno nAtomSize es la longitud de la cadena devuelta si la función tiene éxito y cero (0) si
no hay tal átomo.
SalDDEGetExecuteString
Sintaxis strCommand = SalDDEGetExecuteString ( nMsglParam)
Descripción Una aplicación de servidor llama a esta función para obtener la cadena de comando enviado por un cliente. Esta función
convierte el lParam del mensaje SAM_DDE_ClientExecute partir de un valor numérico a un valor de cadena y devuelve
el valor de cadena en strCommand.
Valor de retorno strCommand es la cadena de comando enviado por una aplicación cliente al servidor.
SalDDEPost
Sintaxis Nreturn = SalDDEPost ( hWndReceiver, nMessage, hWndSender, nLowlParam, nHighlParam)
• WM_DDE_INITIATE
SalDDEPost coloca un mensaje en la cola de mensajes del receptor, permitiendo que los mensajes de proceso
receptor ya en su primera cola de mensajes. SalDDEPost devuelve sin esperar a que el receptor para procesar el
mensaje.
nLowlParam Número. La palabra de orden inferior del parámetro lParam envía con el
mensaje.
nHighlParam Número. La palabra de orden del parámetro lParam envía con el mensaje.
Valor de retorno Nreturn es un valor distinto de cero si la función tiene éxito y cero (0) en caso contrario.
SalDDERequest
Sintaxis Bok = SalDDERequest ( hWndClient, strService, strServerTopic, strServerItem, nTimeout, strData)
Descripción Una aplicación cliente llama a esta función a pedir a un servidor para enviar los datos.
parámetros hWndClient Identificador de ventana. identificador de ventana del cliente asociado con el servicio
DDE, el tema y tema.
strData Recibe cadena. Una variable de cadena o una ventana en la aplicación cliente que puede recibir
datos. La ventana debe ser capaz de mantener un valor (por ejemplo, un campo de datos, columna
de ventana de la tabla, el campo de líneas múltiples, o un cuadro combinado) y debe ser definida
con un tipo de datos de cadena.
SalWaitCursor (FALSO)
Llamar SalMessageBox ( 'SalDDERequest al servidor de Excel
fallido', 'DDE Error', MB_OK | MB_ICONHAND)
SalDDESend
Sintaxis Nreturn = SalDDESend ( hWndReceiver, nMessage, hWndSender, nLowlParam, nHighlParam)
nLowlParam Número. La palabra de orden inferior del parámetro lParam envía con el
mensaje.
nHighlParam Número. La palabra de orden del parámetro lParam envía con el mensaje.
naplicación, nTopic)
SalDDESendAll
Sintaxis Nreturn = SalDDESendAll ( nMessage, hWndSender, nLowlParam, nHighlParam)
Descripción Difunde un mensaje WM_DDE_INITIATE y no vuelve hasta que todos los receptores han procesado el
mensaje.
nLowlParam Número. La palabra de orden inferior del parámetro lParam envía con el
mensaje.
Valor de retorno Nreturn es un valor distinto de cero si la función tiene éxito, y cero (0) en caso contrario.
naplicación, nTopic)
SalDDESendExecute
Sintaxis Bok = SalDDESendExecute ( hWndClient, strService, strServerTopic, strServerItem,
nTimeout, strCommand)
Descripción Un cliente llama a esta función para enviar un comando WM_DDE_EXECUTE a un servidor.
parámetros hWndClient Identificador de ventana. identificador de ventana del cliente asociado con el servicio
DDE, el tema y tema.
strCommand Cuerda. La cadena de comandos para enviar a strService. Para la compatibilidad con
otras aplicaciones DDE, siga las reglas de sintaxis para cadenas de comandos. Para
obtener información acerca de las reglas de sintaxis, consulte la sección sobre el
mensaje WM_DDE_EXECUTE al final del capítulo en el DDE
Centura
Referencia del desarrollador .
SalWaitCursor (FALSO)
Llamar Sal cuadro de mensaje ( 'SalDDESendExecute' ||
SalDDESendToClient
Sintaxis Bok = SalDDESendToClient ( hWndServer, strData, nClientID, nTimeout)
Descripción Una aplicación de servidor llama a esta función para enviar datos a los clientes. Utilice
SalDDESendToClient con las dos conversaciones enlace fríos y calientes.
parámetros hWndServer Identificador de ventana. identificador de ventana del servidor asociado con el servicio
DDE, el tema y tema.
nClientID Número. identificador de ventana del cliente convertir en un número. Para una
conversación enlace activo, especifique cero (0). Centura actualiza todos los clientes
con enlace con los datos en strData. Para una conversación enlace frío, el servidor
SalDDESetCmd
Sintaxis Bok = SalDDESetCmd ( nHighlParam, strCommand)
Descripción Asigna una cadena de comando a los datos referenciados por la palabra de orden superior de la IParam en un
mensaje WM_DDE_EXECUTE.
WM_DDE_EXECUTE, hWndForm, 0,
nCommand)
Descripción Asigna un valor a los datos referenciados por la palabra de orden inferior de la lParam en un mensaje
WM_DDE_DATA o WM_DDE_Poke.
parámetros NDATA Número. La manija para el objeto de memoria que contiene los datos y otra
información.
nItem)
SalDDESetOptions
Sintaxis Bok = (SalDDESetOptions nOptions, nFlags, NFORMAC)
Descripción Asigna un valor a los datos referenciados por la palabra de orden inferior de la lParam en un mensaje
WM_DDE_ADVISE.
parámetros nOptions Número. La manija para el objeto de memoria que especifica cómo los datos se va a
enviar.
nOptions, nItem)
SalDDEStartServer
Sintaxis Bok = SalDDEStartServer ( hWndServer, strService, strServerTopic, strServerItem
)
Descripción Una aplicación de servidor llama a esta función para señalar clientes que está listo para aceptar conexiones de ellos. Una
aplicación de servidor debe llamar a esta función para que los clientes puedan conectarse a él.
parámetros hWndServer Identificador de ventana. identificador de ventana del servidor asociado con la
aplicación DDE, el tema y tema.
SalDDEStartSession
Sintaxis Bok = SalDDEStartSession ( hWndDest, strService, strServerTopic, strServerItem, nTimeout)
Descripción Un cliente llama a esta función para iniciar una conversación enlace activo con una aplicación de servidor.
parámetros hWndDest Identificador de ventana. El mango (o nombre) de un objeto que puede contener un valor (tal como
combinado).
SalDDEStopServer
Sintaxis Bok = SalDDEStopServer ( hWndServer)
Descripción Un servidor llama a esta función para poner fin a las operaciones del servidor DDE. El servidor debe llamar
SalDDEStopServer para cada SalDDEStartServer éxito.
parámetros hWndServer Identificador de ventana. identificador de ventana del servidor asociado con el servicio
DDE, el tema y tema.
SalDDEStopSession
Sintaxis Bok = SalDDEStopSession ( hWndDest)
Descripción Un cliente llama a esta función para finalizar una conversación enlace activo con una aplicación de servidor. El cliente
debe llamar SalDDEStopSession para cada SalDDEStartSession éxito.
SalDestroyWindow
Sintaxis Bok = SalDestroyWindow ( hWndDestroy)
Descripción Destruye una ventana de formulario, una ventana de la tabla de nivel superior, o un cuadro de diálogo modal creada con SalCreateWindow.
En el caso de una ventana de formulario o ventana de la tabla de nivel superior, puede haber creado automáticamente en tiempo de
ejecución.
Ejemplo en SAM_Click
Llamada SalDestroyWindow ( hWndForm)
SalDisableWindow
Sintaxis Bok = SalDisableWindow ( hWndDisable)
Si la ventana contiene texto (por ejemplo, un botón pulsador), el texto aparece en gris. Si la ventana es un campo
de datos, no puede recibir el foco.
Ejemplo en SAM_Create
Llamada SalDisableWindow ( pbUpdate)
SalDisableWindowAndLabel
Sintaxis Bok = SalDisableWindowAndLabel ( hWndDisable)
Descripción Desactiva entrada del teclado y del ratón a una ventana y grises a cabo su etiqueta asociada. Una etiqueta es el
texto de fondo que precede inmediatamente a la ventana en el esquema. El texto debe tener un fundamento
mneumonic.
Si la ventana contiene texto (por ejemplo, un botón pulsador), el texto aparece en gris. Si la ventana es un campo
de datos, no puede recibir el foco.
SalEnableWindowAndLabel
SalGetWindowLabelText
SalHideWindowAndLabel
SalSetWindowLabelText
SalShowWindowAndLabel
SalDlgChooseColor
Sintaxis Bret = SalDlgChooseColor ( hWndOwner, nColor)
Descripción Muestra el cuadro de diálogo Color de Windows donde el usuario puede seleccionar un color existente o crear una
parámetros hWndOwner Identificador de ventana. El mango (o nombre) del propietario del cuadro de diálogo.
Especificar hWndNULL si no tiene dueño.
Valor de retorno BRET es TRUE si el usuario selecciona un color y FALSE si el usuario hace clic en el empuje Cancelar
botón.
Ejemplo en SAM_Click
Llamada SalDlgChooseColor (FrmMain, nColor)
SalDlgChooseFont
Sintaxis Bret = SalDlgChooseFont ( hWndOwner, strFontName, nsize, nEnhancements, nColor)
Descripción Muestra el cuadro de diálogo de fuentes de Windows, donde el usuario puede elegir un tipo de letra, así como su tamaño, estilo,
parámetros hWndOwner Identificador de ventana. El mango (o nombre) del propietario del cuadro de diálogo.
Especificar hWndNULL si no tiene dueño.
nEnhancements Recibe Número. Las mejoras de fuente (cursiva, negrita, etc.), en su caso, que el
usuario selecciona.
nColor Recibe Número. Especificar el color del texto inicial. Cuando regresa
SalDlgChooseFont, nColor es el color del texto que el usuario selecciona.
Valor de retorno Bret es TRUE si el usuario elige un tipo de letra y FALSO si el usuario hace clic en el pulsador Cancelar
botón.
SalDlgOpenFile
Sintaxis Bret = SalDlgOpenFile ( hWndOwner, strDlgTitle, strFilters, nFilters, nIndex, strFile, strPath)
Descripción Muestra un cuadro de diálogo de Windows en el que el usuario puede seleccionar un archivo para abrirlo.
parámetros hWndOwner Identificador de ventana. El mango (o nombre) del propietario del cuadro de diálogo.
Especificar hWndNULL si no tiene dueño.
strFilters Cuerda. Una serie de filtros de archivos y sus descripciones. Cada filtro debe tener
una descripción que precede al filtro en la matriz. Por ejemplo, para permitir a los
usuarios abrir archivos con sólo extensiones específicas, rellenar la matriz strFilters
con filtros tales como:
elementos contiene tres filtros. Especificar 6 para mostrar los tres filtros.
Puede limitar el número de filtros que se muestran. Por ejemplo, para mostrar sólo los
dos primeros filtros (* .exe y .dll *), especifique 4.
strFile Recibe cadena. El nombre del archivo que el usuario elija. Para inicializar el cuadro
combinado en el que la pantalla los nombres de archivo, asigne un nombre de archivo a una
variable antes de llamar SalDlgOpenFile. En la llamada SalDlgOpenFile posterior, especifique
la variable para este parámetro. Si el valor de la variable es incorrecta o no válida, Centura
ignora su intento de establecer el valor de la pantalla por defecto.
strPath Recibe cadena. El nombre de la ruta completa del archivo que el usuario elija. Para
inicializar el cuadro combinado en el que la pantalla rutas, asignar una ruta a una variable
antes de llamar SalDlgOpenFile. En la llamada SalDlgOpenFile posterior, especifique la
variable para este parámetro. Si el valor de la variable es incorrecta o no válida, Centura
ignora su intento de establecer el valor de la pantalla por defecto.
Valor de retorno Bret es TRUE si el usuario especifica un nombre de archivo y FALSO si el usuario hace clic en el Cancelar
presionar el botón.
en SAM_Create
Set strFilters [0] = 'Dynamic Link Libraries' Set strFilters [1]
SalDlgSaveFile
Sintaxis Bret = SalDlgSaveFile ( hWndOwner, strDlgTitle, strFilters, nFilters, nIndex, strFile, strPath)
Descripción Muestra un cuadro de diálogo de Windows en el que el usuario puede guardar un archivo. Si no se especifica una
extensión de archivo, Centura guarda el archivo con la extensión que muestra el cuadro Guardar como tipo combinado.
parámetros hWndOwner Identificador de ventana. El mango (o nombre) del propietario del cuadro de diálogo.
Especificar hWndNULL si no tiene dueño.
strFilters Cuerda. Una serie de filtros de archivos y sus descripciones. Cada filtro debe tener una
descripción que precede al filtro en la matriz. Por ejemplo, para permitir a los usuarios
guardar archivos con extensiones específicas sólo, rellenar la matriz strFilters con filtros
tales como:
elementos contiene tres filtros. Especificar 6 para mostrar los tres filtros.
Puede limitar el número de filtros que se muestran. Por ejemplo, para ver sólo los
dos primeros filtros (* .exe y .dll *), especifique 4.
nIndex Recibe Número. El filtro que elija el usuario. Esto refleja el formato en el que Centura
guarda el archivo. La extensión de un archivo no implica formato. Por defecto, si el
usuario no especifica una extensión de archivo, Centura guarda el archivo con la
primera extensión strFilters. En este caso, la extensión de archivo por defecto es .EXE.
Por ejemplo, si el usuario elige bibliotecas de vínculos dinámicos, pero no especifica una
extensión de archivo, el archivo se guarda en formato DLL pero con una extensión .EXE.
strPath El nombre de la ruta completa del archivo que el usuario elija. Para inicializar el cuadro
combinado en el que la pantalla rutas, asignar un nombre de ruta para una variable antes de
llamar SalDlgSaveFile. En la llamada SalDlgSaveFile posterior, especifique la variable para
este parámetro. Si el valor de la variable es incorrecta o no válida, Centura ignora su intento
de establecer el valor de la pantalla por defecto.
en SAM_Create
Set strFilters [0] = 'Dynamic Link Libraries' Set strFilters [1]
strFilters [3] = '* .exe' strFilters ajuste [4] = ' Set strFilters [5]
SalDragDropDisableDrop
Sintaxis Bok = SalDragDropDisableDrop ( )
Ejemplo en SAM_Click
Llamada SalDragDropDisableDrop ()
SalDragDropEnableDrop
Sintaxis Bok = SalDragDropEnableDrop ( )
()
SalDragDropGetSource
Sintaxis Bok = SalDragDropGetSource ( HwndSource, nX, NY)
Descripción Recupera el identificador de la ventana de origen y la ubicación del ratón en esa ventana cuando inicia el
modo de arrastre.
parámetros HwndSource Recibe identificador de ventana. El mango de la ventana de la fuente. Estos tipos de ventanas
Ejemplo en SAM_Click
Llamada SalDragDropGetSource (HwndSource, nX, NY)
Descripción Recupera el identificador de la ventana de destino y la ubicación del ratón en esa ventana.
Ejemplo en SAM_Click
Llamada SalDragDropGetTarget (HWndRecv, nX, NY)
SalDragDropStart
Sintaxis Bok = SalDragDropStart ( HwndSource)
Descripción Inicia el modo de arrastre. Debe tener uno de los botones del ratón (izquierda, centro, derecha) deprimido.
Ejemplo en SAM_Click
Llamada SalDragDropStart (FrmMain)
SalDragDropStop
Sintaxis Bok = SalDragDropStop ( )
SalDrawMenuBar
Sintaxis Bok = SalDrawMenuBar ( hWndForm)
Descripción Vuelve a dibujar la barra de menú de una ventana determinada forma o ventana de la tabla de nivel superior. Llamar a esta función para
hacer que los elementos de menú de nivel superior para ser activadas o desactivadas. Para un elemento de menú de nivel superior o en el
menú emergente, un Activado cuando la variable sólo se evalúa cuando se llama SalDrawMenuBar o cuando la barra de menú se vuelve a
parámetros hWndForm Identificador de ventana. El mango (o nombre) de la ventana del formulario o ventana de la tabla de
Ejemplo en SAM_Click
Llamada SalDrawMenuBar ( frmMain)
SalDropFilesAcceptFiles
Sintaxis Bok = (SalDropFilesAcceptFiles hWnd, bAccept)
Descripción Indica si una ventana puede aceptar un archivo desde el Administrador de archivos de Windows'.
bAccept Boole. Especifique si CVent puede aceptar un archivo desde el Administrador de archivos
de Windows'.
El valor predeterminado para editables imágenes es TRUE; el valor por defecto para todos los
Descripción Recupera los nombres de los archivos cayeron en una ventana. La recepción del mensaje
SAM_DropFilesmsg_SAM_DropFiles indica que el usuario se redujo archivos en la ventana.
Valor de retorno nfiles es el número de archivos de caídas Si la función tiene éxito y cero (0) si el
función falla. SalDropFilesQueryFiles falla a menos que se llama como el resultado de la recepción del
mensaje SAM_DropFiles.
Ejemplo en SAM_Click
Set = nfiles SalDropFilesQueryFiles (HwndSource,
sArrayFiles)
SalDropFilesQueryPoint
Sintaxis Bok = SalDropFilesQueryPoint ( hWnd, nX, NY)
Descripción Encuentra la ubicación del ratón en una ventana en el momento en que el usuario se redujo archivos en la
ventana. La recepción del mensaje SAM_DropFiles indica que el usuario se redujo archivos en la ventana.
Ejemplo en SAM_Click
Llamada SalDropFilesQueryPoint (HWnd, nX, NY)
SalEditCanCopyTo
Sintaxis Bok = SalEditCanCopyTo ( )
Descripción Esta función devuelve TRUE si una imagen editable tiene el enfoque y contiene un objeto que se puede copiar en un archivo.
Se puede utilizar esta función en la sección Habilitado Cuando para una copia al elemento del menú.
Valor de retorno Bok es cierto si una imagen editable tiene el enfoque y contiene un objeto, y FALSO
de otra manera. Bok es cierto incluso cuando el contenido de la imagen no son el resultado de una pasta de la operación.
Ejemplo Menú
Menú emergente: & Editar
...
Configuración del menú
Descripción Esta función devuelve TRUE si se ha seleccionado los datos de un campo de datos, campo de varias líneas, columna de ventana de la tabla,
o una imagen editable. Se puede utilizar esta función en la sección cuando se habilita para un elemento de menú Cortar.
SalEditCanPaste
Sintaxis Bok = SalEditCanPaste ( )
Descripción Esta función devuelve TRUE si hay datos en el portapapeles que se pueden pegar en el cuadro editable con el
foco. Se puede utilizar esta función en la sección cuando se habilita para un elemento de menú Pegar.
Sin Parámetros
Valor devuelto
Bok es TRUE si hay datos en el portapapeles para ser pegado y de lo contrario.
SalEditCanPasteFrom
Sintaxis Bok = SalEditCanPasteFrom ( )
Descripción Esta función devuelve TRUE si una imagen editable tiene el foco. Se puede utilizar esta función en la sección
Habilitado Cuando para una Pegar Desde elemento de menú.
Valor de retorno
SalEditCanUndo
Sintaxis Bok = SalEditCanUndo ( )
Descripción Esta función devuelve TRUE si hay alguna edición de un campo de datos, campo de varias líneas, columna de ventana de la tabla, o
una imagen que se puede deshacer. Se puede utilizar esta función en la sección cuando se habilita para un elemento de menú
Deshacer.
Sin Parámetros Valor devuelto Bok es TRUE si no hay ningún tipo de edición de deshacer y de lo contrario.
...
SalEditClear
Sintaxis Bok = SalEditClear ( )
Descripción Elimina los datos seleccionados a partir del campo de datos, campo de varias líneas, columna de ventana de la tabla, o imagen con el
enfoque. lugares Centura borran los datos en memoria intermedia de anulación de Windows'.
SalEditCopy
Sintaxis Bok = SalEditCopy ( )
Descripción Copias seleccionadas datos de un campo de datos, campo de varias líneas, columna de ventana de la tabla, o una imagen y la
coloca en el portapapeles.
...
acciones de menú
Llamada SalEditCopy ()
SalEditCopyString
Sintaxis Bok = SalEditCopyString ( strString)
SalEditCopyTo
Sintaxis Bok = SalEditCopyTo ( )
Descripción Copia un objeto a un archivo de una imagen editable. La imagen debe tener el foco. Esta función sólo funciona
Llamada SalEditCopyTo ()
SalEditCut
Sintaxis Bok = SalEditCut ( )
Descripción Corta datos seleccionados de un campo de datos, campo de varias líneas, columna de ventana de la tabla, o una imagen y la coloca en el
portapapeles.
SalEditPaste
Sintaxis Bok = SalEditPaste ( )
Descripción Pastas datos del portapapeles en el campo de datos, campo de varias líneas, columna de ventana de la tabla, o imagen
con el enfoque.
Llamada SalEditPaste ()
SalEditPasteFrom
Sintaxis Bok = SalEditPasteFrom ( )
Esta función muestra el cuadro de diálogo Pegar desde donde el usuario puede seleccionar un archivo para pegar en el
cuadro.
El usuario puede seleccionar un archivo de cualquier tipo, incluso si el tipo de archivo no está en la lista anterior. Centura todavía lo
pega en la imagen con un icono de documento genérico para su imagen. El contenido del archivo están disponibles para la aplicación
a través de la función SalPicGetString.
Llamada SalEditPasteFrom ()
SalEditPasteString
Sintaxis Bok = SalEditPasteString ( strString)
SalEditUndo
Sintaxis Bok = SalEditUndo ( )
Descripción Deshace la última edición en un campo de datos, campo de varias líneas, columna de ventana de la tabla, o una imagen. Edición que
puede deshacer incluye la inserción de texto, texto de corte, limpieza de texto y pegar texto.
SalEnableWindow
Sintaxis Bok = SalEnableWindow ( hWndEnable)
SalEnableWindowAndLabel
Sintaxis Bok = SalEnableWindowAndLabel ( hWndEnable)
Descripción Activa la entrada de teclado y el ratón a una ventana y permite su etiqueta asociada también.
Ejemplo en SAM_Click
Llamada SalEnableWindowAndLabel (DfName)
SalEndDialog
Sintaxis Bok = SalEndDialog ( hWndModal, Nreturn)
Descripción Destruye un cuadro de diálogo modal y devuelve el control al llamador del SalModalDialog.
parámetros hWndModal Identificador de ventana. El mango (o nombre) del cuadro de diálogo modal para destruir.
Ejemplo en SAM_Click
Llamada SalEndDialog (HWndForm, 0)
SalFileClose
Sintaxis Bok = SalFileClose ( hFile)
parámetros hFile Recibe identificador de archivo. El mango del archivo para cerrar. Cuando la función
devuelve el valor de este parámetro se vuelve nula.
SalFileCopy
Sintaxis nstatus = SalFileCopy ( strSourcePath, strDestPath, bOverWrite)
FILE_CopyDest
FILE_CopyExist
FILE_CopyOK
FILE_CopyRead
FILE_CopySrc
FILE_CopyWrite
Ejemplo en SAM_AppStartup
Establecer bLogFileSaved = SalFileCopy ( 'C: \\ DB \\ APP.LOG',
( 'C: \\ DB \\ APP.OLD', TRUE)
SalFileCreateDirectory
Sintaxis Bok = SalFileCreateDirectory ( strDir)
Valor de retorno Bok es TRUE si la función tiene éxito y FALSE si un directorio o un archivo con el
nombre especificado ya existe, o si la ruta especificada en el directorio no puede ser encontrado.
SalFileGetC
Sintaxis Bok = SalFileGetC ( hFile, nChar)
Descripción Devuelve el siguiente carácter en un archivo abierto. Debe utilizar esta función en lugar de la función SalFileGetChar
si el archivo contiene no ASCII (ANSI) o caracteres de 16 bits. Si el carácter devuelto es un personaje de 16 bits, el
byte inicial del personaje está en el byte de orden, y el byte final está en el byte de orden inferior. Para obtener el
byte inicial, utilice SalNumberHighand para obtener el byte final, utilice SalNumberLow.
Valor de retorno Bok es TRUE si la función tiene éxito y FALSE si la función es incapaz de leer el
siguiente carácter a partir del archivo, o si un identificador de archivo no válido se pasa en hFile.
Ejemplo en SAM_AppStartup
Llamada SalFileOpen (HFile, 'C: \\ DB \\ APP.LOG',
OF_Read | OF_Binary)
Valor de retorno nChar es un número que representa un carácter ANSI. Al final del archivo,
SalFileGetChar devuelve un -1.
SalFileGetCurrentDirectory
Sintaxis Bok = SalFileGetCurrentDirectory ( strPath)
parámetros strPath Recibe cadena. El nombre de ruta completo, incluyendo la letra de la unidad, del
directorio de trabajo actual.
Ejemplo en SAM_AppStartup
Si no SalFileGetCurrentDirectory (StrCurrentDir)
Llamar SalMessageBox ( 'No se pudo obtener actual
directorio', 'Error', 0
SalFileGetDateTime
Sintaxis Bok = SalFileGetDateTime ( strFileName, dtDateTime)
parámetros strFileName Cuerda. El nombre del archivo cuya fecha de modificación que desee.
SalFileGetDrive
Sintaxis strDriveLetter = SalFileGetDrive ( )
Sin Parámetros Valor devuelto strDriveLetter es una cadena que identifica la unidad de disco actual. El primer carácter es una
Ejemplo en SAM_AppStartup
Si SalFileGetDrive () = 'A'
Establecer blsDriveA = VERDADERO
Else
SalFileGetStr
Sintaxis Bok = SalFileGetStr ( hFile, strBuffer, nBufferSize)
Descripción Devuelve la siguiente línea de un archivo abierto. Centura despoja de la posterior retorno de carro / línea de la
cadena devuelta.
Valor de retorno Bok es TRUE si el archivo se lee con éxito y de lo contrario. FALSO es también
devuelta a la final del archivo.
Descanso
strFileName Cuerda. El nombre del archivo que desea abrir, crear, eliminar, o prueba.
nStyle Número. Una constante que especifica el estilo en que para abrir el archivo. nStyle
puede ser una o más estilos combinados usando el bit a bit OR | operador ().
SalListFiles
SalFileOpenExt
SalFileOpenExt
Sintaxis Bok = SalFileOpenExt ( hFile, strFileName, nStyle, strReopen)
Descripción Abre o re-abre un archivo. nombres de archivo largos de hasta 260 caracteres es compatible.
parámetros hFile Recibe identificador de archivo. El mango del archivo abierto o reabierto.
strFileName Cuerda. El nombre del archivo que desea abrir, crear, eliminar, o prueba.
nStyle Número. Una constante que especifica el estilo en que para abrir el archivo. nStyle
puede ser una o más estilos combinado usando el
O (|) del operador.
Ejemplo en SAM_Create
Si SalFileOpenExt (HFile, 'C: \\ AUTOEXEC.BAT', OF_Read,
strReopen)
SalFilePutC
Sintaxis Bok = SalFilePutC ( hFile, nChar)
Descripción Escribe un carácter en un archivo abierto. Utilice esta función en lugar de SalFilePutChar si el
personaje es un no-ASCII (ANSI) o caracteres de 16 bits.
Valor de retorno Bok es TRUE si la función tiene éxito y FALSE si no es capaz de escribir en hFile.
Ejemplo Lazo
Llamada SalFilePutC ( hFile, nNull) Si nCount = 5
Conjunto romper
nPosiciones = nPosiciones + 1
SalFilePutChar
Sintaxis Bok = SalFilePutChar ( hFile, nChar)
nChar Número. El valor numérico del carácter ANSI para escribir en hFile.
(HFile, nChar)
Descripción Escribe una cadena en un archivo abierto. Centura añade un carácter retorno de carro / línea a
la cuerda.
Ejemplo Lazo
! Leer cada línea del archivo de origen y escribirla en el archivo de
destino
SalFileRead
Sintaxis nResult = SalFileRead ( hFile, strBuffer, nBufferLength)
Descripción Lee una memoria intermedia de caracteres desde un archivo abierto en una cadena.
Valor de retorno nResult es el número de bytes leídos. En el final del archivo, SalFileRead devuelve un recuento de bytes
SalFileRemoveDirectory
Sintaxis Bok = SalFileRemoveDirectory ( strDir)
parámetros strDir Cuerda. El nombre de la ruta completa del directorio que desea eliminar.
Valor de retorno Bok es TRUE si la función tiene éxito y FALSE si falla. SalFileRemoveDirectory
También devuelve FALSO si strDir contiene archivos o directorios otros.
Ejemplo en SAM_AppStartup
Establecer bNotesOldDeleted = SalFileRemoveDirectory (StrDir)
SalFileSeek
Sintaxis Bok = SalFileSeek ( hFile, nBytes, Nposition)
Descripción Posiciona el puntero de archivo en un archivo abierto. La siguiente operación de archivo (como una lectura o escritura) tiene lugar en
esta nueva ubicación.
nBytes Número. La posición específica del puntero del fichero; el número de bytes de
Nposition donde tendrá lugar la siguiente operación de archivo.
Nposition Número. La posición general del puntero del fichero; uno de los valores
siguientes:
FILE_SeekBegin
FILE_SeekCurrent
FILE_SeekEnd
Descripción Cambia el directorio de trabajo actual. Si la ruta especificada no contiene una letra de unidad, se cambia el directorio
actual de la unidad predeterminada. De lo contrario, el directorio actual de la unidad especificada se cambia sin hacer que
la corriente de excitación.
parámetros strPath Cuerda. El nombre de ruta del nuevo directorio de trabajo actual.
Ejemplo en SAM_AppStartup
Establecer DirOk = SalFileSetCurrentDirectory ( 'C: \\ NOTAS \\ REL2')
SalFileSetDateTime
Sintaxis Bok = SalFileSetDateTime ( strFileName, dtDateTime)
parámetros strFileName Cuerda. El nombre del archivo cuya fecha de modificación que desea establecer.
Ejemplo en SAM_Click
Establecer Bok = SalFileSetDateTime ( 'Sql.ini', SalDateCurrent ())
SalFileSetDrive
Sintaxis Bok = SalFileSetDrive ( strDriveLetter)
parámetros strDriveLetter String.0 La nueva letra de la unidad de disco. La longitud del valor de este
parámetro es un carácter. Si especifica un valor mayor que este, Centura lee sólo el
primer carácter.
Ejemplo en SAM_AppStartup
Establecer bDriveIsC = SalFileSetDrive ( 'C')
SalFileTell
Sintaxis nPos = SalFileTell ( hFile)
Valor de retorno nPos es la posición actual en hFile. Si se produce un error, nPos es igual a -1.
SalFileWrite
Sintaxis nResult = SalFileWrite ( hFile, strBuffer, nBufferLength)
SalFmtFieldToStr
Sintaxis Bok = SalFmtFieldToStr ( hWndField, strValue, bFormat)
Descripción Copia el contenido de un campo de datos o columna ventana de la tabla en una cadena. Esta función también le permite copiar
el formato de los datos.
parámetros hWndField identificador de ventana. El mango (o nombre) de la columna de campo de datos o la ventana de
la tabla de la cuyo valor (y, opcionalmente, cuyo formato) que desea copiar.
bFormat Boole. Especifica si desea mantener el formato del campo. Si es TRUE, copias
CENTURA el contenido del campo con formato a la cadena; Si es falso, Centura
copia el contenido del campo sin formato a la cadena.
Ejemplo en SAM_FieldEdit
Llamada SalFmtFieldToStr (DfDateTime,
dfDateString, TRUE)
SalFmtFormatDateTime
Sintaxis strDateTime = SalFmtFormatDateTime ( dtDateTime, strPicture)
Descripción Formatos de un valor de fecha / hora con un formato de imagen de fecha / hora determinada. Si no se especifica un formato
de imagen o el que se especifica es válido, Centura utiliza la configuración predeterminada de la sección [INTL] y la sección
[GTITOOLS] definida por el usuario de Win.ini para el formato.
SalFmtFormatNumber
Sintaxis strNumber = SalFmtFormatNumber ( nNúmero, strPicture)
Descripción Formatea un valor numérico utilizando un formato de número de imagen. Si no se especifica un formato de imagen o el
que se especifica es válido, Centura utiliza la configuración predeterminada de la sección [INTL] y la sección [GTITOOLS]
definida por el usuario de Win.ini para el formato.
SalFmtIsValidPicture
SalFmtGetFormat
Sintaxis NFormat = SalFmtGetFormat ( hWndField)
Descripción Devuelve el formato actual de una columna de campo de datos o ventana de la tabla.
Nota: Algunos de los parámetros tienen subparámetros. Por ejemplo, el formato de fecha tiene tanto un subparámetro que
especifica carácter separador de una fecha y un subparámetro que especifica la secuencia mes / día / año.
parámetros hWndField Identificador de ventana. El mango (o nombre) del campo de datos o columna ventana
de la tabla a formato.
Valor de retorno NFormat es un número que indica el formato del campo. El valor de retorno es uno de
las siguientes constantes.
FMT_Format_Date
FMT_Format_DateTime
FMT_Format_Picture
FMT_Format_Time
FMT_Format_Unformatted
FMT_Format_Format_Currency
FMT_Format_Decimal
FMT_Format_Percentage
FMT_Format_Invisible
FMT_Format_Lowercase
FMT_Format_Uppercase
FMT_Format_Unformatted
Se activa cuando:
SalFmtGetInputMask
Sintaxis Bok = SalFmtGetInputMask ( hWnd, strMask)
Descripción Obtiene la máscara de entrada de una columna de campo de datos o la ventana de la tabla.
Véase el capítulo de formato y validación en la referencia técnica de Centura para más información sobre las máscaras de
entrada.
parámetros CVent Identificador de ventana. El mango (o nombre) de un cuadro combinado, campo de datos, o columna
ventana de la tabla.
Valor de retorno Bok es TRUE si la función tiene éxito y FALSE si CVent no es una ventana válida
manejar o el objeto no tiene una máscara de entrada.
Ejemplo en SAM_Click
Establecer Bok = SalFmtGetInputMask (DF1, DF2)
SalFmtGetPicture
Sintaxis Bok = SalFmtGetPicture ( hWndField, strPicture)
Descripción Obtiene el formato de la imagen de una columna de campo de datos o la ventana de la tabla.
parámetros hWndField Identificador de ventana. El mango (o nombre) de la columna de campo de datos o la
ventana de la tabla cuyo formato de imagen que desee.
Valor de retorno Bok es TRUE si la función tiene éxito, y FALSE si el campo de datos o ventana de la tabla
columna no es la imagen con formato.
SalFmtIsValidField
Sintaxis bValid = SalFmtIsValidField ( hWndField)
Descripción Valida el contenido de una columna de campo de datos o ventana de la tabla usando el perfil actual.
Centura despoja de caracteres de formato y valida el contenido de un campo según el tipo. Después de eso, Centura
valida el formato de imagen caracteres adicionales que se introducen para garantizar que se ajustan a los requisitos
del perfil.
Valor de retorno bValid es TRUE si el contenido del campo son válidos y FALSE si el contenido del campo son
inválido.
Ejemplo en SAM_Validate
Si SalFmtIsValidField (dfDateTime)
Llamada SalFmtValidateField (DfDateTime,
FMT_Validate_None)
SalFmtIsValidInputMask
Sintaxis Bok = SalFmtIsValidInputMask ( strMask)
Descripción Valida la máscara de entrada de una columna de campo de datos o la ventana de la tabla. Véase el capítulo de formato y validación
en la referencia técnica de Centura para más información sobre las máscaras de entrada.
Valor de retorno Bok es TRUE si strMask es una máscara de entrada válida y FALSO si no es válido.
Ejemplo en SAM_Click
Si SalFmtIsValidInputMask (DF1)
Establecer gl2 = 'es válido'
Else
SalFmtIsValidPicture
Sintaxis Bok = SalFmtIsValidPicture ( strPicture, nTipo)
M / d / aa 03.18.89
dd-MM-aaaa 18-03-1989
7,00%
0.00E + 00 3.65e + 03
0.00E-00 3.65e03
$ #, ## 0; ($ #, ## 0) $ 1,350
$ #, ## 0; ($ #, ## 0) ($ 1,350)
0.00 95.00
SalFmtSetPicture
SalFmtKeepMask
Sintaxis Bret = SalFmtKeepMask ( BMantenga)
Descripción Por defecto, Centura elimina caracteres de máscara de entrada cuando se copia el valor en un campo de datos, columna de
ventana de la tabla, o un cuadro combinado. Por ejemplo, si crea un campo de datos con la máscara de entrada AA-AA y
copiar su valor a otro campo de datos, Centura no copia el guión.
Puede llamar SalFmtKeepMask para cambiar el comportamiento predeterminado para que Centura mantiene los caracteres de
máscara de entrada cuando se copia el valor en un campo de datos, columna de ventana de la tabla, o un cuadro combinado. Por
ejemplo, si crea un campo de datos con la máscara de entrada AA-AA y copiar su valor a otro campo de datos, copias Centura el
guión.
Véase el capítulo de formato y validación en el NTURA referencia técnica Centura para más información sobre
las máscaras de entrada.
Si es TRUE, Centura mantiene los caracteres de máscara de entrada cuando se copia un valor.
SalFmtSetFormat
Sintaxis Bok = SalFmtSetFormat ( hWndField, NFORMAC)
perfil de país de un campo determina las características de un formato. Si el campo utiliza el formato por defecto, el perfil en
WIN.INI determina las características de un formato. El formato de un campo debe estar de acuerdo con el tipo de datos del
campo, así que por ejemplo, los campos de número sólo puede ser formateado como valores decimales, porcentajes, o de
divisas.
parámetros hWndField Identificador de ventana. El mango (o nombre) de la columna de campo de datos o la ventana de
la tabla cuyo formato desea establecer.
Valor de retorno Bok es TRUE si la función tiene éxito y FALSE si el formato no se puede establecer como
cuando el formato no es apropiado para el campo especificado.
SalFmtSetInputMask
Sintaxis Bok = SalFmtSetInputMask ( hWnd, strMask)
Descripción Establece la máscara de entrada de una columna de campo de datos o la ventana de la tabla.
Véase el capítulo de formato y validación en la referencia técnica de Centura para más información sobre las máscaras de
entrada.
parámetros CVent Identificador de ventana. El mango (o nombre) de un cuadro combinado, campo de datos, o columna
ventana de la tabla.
strMask Cuerda. La cadena que sujeta la máscara de entrada. Si strMask es una cadena vacía
( ''), establece Centura CVent ser formateado.
SalFmtSetPicture
Sintaxis Bok = SalFmtSetPicture ( hWndField, strPicture)
Descripción Establece el formato de la imagen de una columna de campo de datos o la ventana de la tabla.
Valor de retorno Bok es TRUE si la función tiene éxito y FALSE si falla. Bok es FALSO si alguno de
lo siguiente es cierto:
Descripción Copia una cadena a una columna de campo de datos o la ventana de la tabla. Después de copiar la cadena en el campo, Centura da
formato a la cadena.
parámetros hWndField Identificador de ventana. El mango (o nombre) de la columna de campo de datos o la ventana de
la tabla a la que se asigna la cadena.
Valor de retorno Bok es VERDADERO si el valor de la cadena tiene el mismo formato que el campo de datos o tabla
en SAM_FieldEdit
Llamada SalFmtStrToField (DfDateTime, dfDateString,
CIERTO )
SalFmtUnmaskInput
Sintaxis Bok = SalFmtUnmaskInput ( hWnd, strInput)
Descripción Unmasks the contents of a data field or table window column and puts the result in a string. Unmasking
involves taking control characters out of a string, but does not include converting characters from
lowercase to uppercase and vice versa. See the Formatting and Validating chapter in the Centura
Technical Reference for more about input masks.
Parameters hWnd Window Handle. The handle (or name) of a combo box, data field, or table
window column.
Return Value bOk is TRUE if the function succeeds and FALSE if hWnd is not a valid window
handle or the object does not have an input mask.
SalFmtValidateField
Syntax bOk = SalFmtValidateField ( hWndField, nValidate )
Description Validates and formats a data field's or table window column's contents. Centura strips off formatting
characters and validates a field's contents according to type. After that, Centura validates picture
formatting characters that you enter to ensure that they conform to the profile requirements.
For dates, you must enter the proper separator characters in order for Centura to validate the field
successfully.
Parameters hWndField Window Handle. The handle (or name) of the data field or table window
column to validate and format.
nValidate Number. A constant value that indicates what Centura does if a format error
occurs and the function returns FALSE:
Return Value bOk is TRUE if the function succeeds and FALSE otherwise, such as when the input
is invalid. If bOk is FALSE, Centura optionally displays an error dialog box.
SalFontGet
Syntax bOk = SalFontGet ( hWndFont, strName, nSize, nEnhancement )
Parameters hWndFont Window Handle. The handle (or name) of the window whose font information
you want.
nEnhancment Receive Number. The font enhancements. To combine two or more of the
FONT_Enh* constants, use the OR (|) operator.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalFontGetNames
Syntax nNames = SalFontGetNames ( nGet, strArrayFontNames )
Parameters nGet Number. A constant that specifies whether to get the screen or printer fonts:
SalFontGetSizes
Syntax nSizes = SalFontGetSizes ( nGet, strFontName, nArrayFontSizes )
Parameters nGet Number. Specify whether to get the sizes of a printer or screen font:
nArrayFontSizes Receive Numeric Array. The name of an array of numbers that contains the
font sizes (in points) returned.
SalFontSet
Syntax bOk = SalFontSet ( hWnd, strName, nSize, nEnhancement )
Parameters hWnd Window Handle. The handle (or name) of the window whose font attributes
you want to set.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalFormGetParmNum
Syntax bOk = SalFormGetParmNum ( hWndForm, nParm, nValue )
Description Returns the value of one of three form window parameters: height, width, or number of pages.
Parameters hWndForm Window Handle. The handle (or name) of the form window whose
parameter value you want.
nParm Number. Specify form height, form width, or number of pages to return in
nValue:
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_Create
Call SalFormGetParmNum ( frmMain, FORM_nFormPages,
dfPages )
Description Computes the number of pixels in the number of Centura form units. Centura form units are a unit of
measurement used by functions which move and position Centura objects. Centura computes form units
using physical units (pixels) in conjunction with the window's font size.
bVertical Boolean. If the form units are on the X axis, set this parameter to FALSE. If the
form units are on the Y axis, set this parameter to TRUE.
Return Value nNumPixels is the number of pixels returned if the function succeeds. nNumPixels is
zero (0) if hWnd is invalid.
SalGetDataType
Syntax nDataType = SalGetDataType ( hWnd )
Use this function with internal functions that handle data fields and table window columns generically.
Such internal functions pass only a window handle; the internal function does not know the data type of
the associated window.
Parameters hWnd Window Handle. The handle (or name) of a data field or table window
column.
Return Value nDataType is a number that indicates the data field's or table window column's data
type. Its value is one of a predetermined set of constants (excluding DT_Boolean).
SalGetDefButton
Syntax hWndDef = SalGetDefButton ( hWndParent )
Description Returns the handle of the default push button on a form window or dialog box. The default push button
is the one that has the focus by default.
Parameters hWndParent Window Handle. The handle (or name) of the form window or dialog box.
Return Value hWndDef is the handle of the default push button. It equals if hWndParent is not the
handle of a valid form window or dialog box, or if the window associated with hWndParent does
not have a default push button.
SalGetFirstChild
Syntax hWndChild = SalGetFirstChild ( hWndParent, nTypeMask )
Description Returns the handle of the first child window of the specified type. This function can be used to get MDI
child windows.
Parameters hWndParent Window Handle. The handle (or name) of a form window, dialog box, or
table window whose first child handle you want.
nTypeMask Number. One or more window types combined (using the OR (|) operator) to
create a mask of child window types. Centura only examines those child
windows whose type AND'd with nTypeMask yields a non-zero value.
Return Value hWndChild is the handle of the first child window of the specified type. hWndChild
equals hWndNULL if there is no child window or if hWndParent is invalid.
Parameters No parameters.
Return Value hWndFocus identifies the window that can currently receive input from the keyboard.
SalGetItemName
Syntax bOk = SalGetItemName ( hWnd, strText )
Description Gets the name of an object. Use SalGetItemName to qualify variables in SQL statements.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalGetMaxDataLength
Syntax nDataLength = SalGetMaxDataLength ( hWndObject )
Description Returns the maximum length of a data field, multiline text field, or table window column. Use this function
before assigning a value to any of these objects to ensure that the value fits.
Parameters hWndObject Window Handle. The handle of a data field, multiline text field, or table window
column.
Return Value nDataLength is a number that specifies the maximum length of hWndObject. A
length of DW_Default (-1) indicates that the object was declared with a length of ‘Default’.
SalGetNextChild
Syntax hWndNextChild = SalGetNextChild ( hWndChild, nTypeMask )
Description Returns the handle of the next child window that matches a specified type. Use this function after calling
SalGetFirstChild to get the other child window siblings. If you want this function to work for background text,
lines, and frames, set the system variable bStaticsAsWindows to TRUE. This is a global system variable,
so the setting persists until you change it.
Parameters hWndChild Window Handle. The handle (or name) of a child window. You can specify the
return value of SalGetFirstChild.
nTypeMask Number. One or more window types combined (using the OR (|) operator) to
create a mask of child window types. Centura only examines those child
windows whose type AND'd with nTypeMask yields a non-zero value.
Return Value hWndNextChild is the handle of the next child window of the specified type.
hWndNextChild equals hWndNULL if there is no child window or if hWndChild is invalid.
SalGetProfileInt
Syntax nValue = SalGetProfileInt ( strSection, strEntry, nDefault, strFileName )
Description Retrieves the integer value of an entry in the specified section of an initialization file or registry.
nDefault Number. Specify the default value (0 to 32,767) to return if the function cannot
find the entry.
strFileName String. The name of the initialization file or company name depending on the
settings made using the SalUseRegistry function. If you are searching for an
INI file and do not specify the full path, Centura searches for the file in the
Windows subdirectory.
SalGetProfileString
Syntax nBytes = SalGetProfileString ( strSection, strEntry, strDefault, strValue, strFileName )
Description Retrieves the string value of an entry in the specified section of an initialization file or registry.
strDefault String. Specify the default value to return if the function cannot find the entry.
strFileName String. The name of the initialization file or company name depending on the
settings made using the SalUseRegistry function. If you are searching for an
INI file and do not specify the full path, Centura searches for the file in the
Windows subdirectory.
Return Value nBytes is the number of bytes copied to strValue, not including the terminating null
character.
SalGetType
Syntax nType = SalGetType ( hWnd )
Use SalGetType with internal functions that process objects generically. Such internal functions pass only a
window handle; the internal function does not know the type of the associated object.
Return Value nType is a number that indicates the object's type. The value returned is one of a
predetermined set of constants.
SalGetVersion
Syntax nType = SalGetVersion ( )
Description Returns the Centura version. For example, SalGetVersion returns 400 for Centura v4.0.0.
Parameters No parameters.
Return Value nType is a number that indicates the Centura version number.
Important: The background text does not require a mnemonic for the functions listed above to operate.
Return Value nLength is a number that indicates the length of strText. nLength is zero (0) if the
window has no text.
SalGetWindowLoc
Syntax bOk = SalGetWindowLoc ( hWnd, nX, nY )
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
( pbExample, nX, nY )
SalGetWindowSize
Syntax bOk = SalGetWindowSize ( hWnd, nWidth, nHeight )
nWidth Receive Number. The width of the window, specified in Centura form
units.
nHeight Receive Number. The height of the window, specified in Centura form
units.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalGetWindowState
Syntax nState = SalGetWindowState ( hWnd )
Parameters hWnd Window Handle. The handle (or name) of a window. This function fails if you
specify a window name that has not been created.
Return Value nState is a constant that indicates a window's current state. It is equal to one of a
predefined set of values.
Example On SAM_Click
If SalGetWindowState ( fwDataWindow ) != Window_Normal
SalGetWindowText
Syntax nLength = SalGetWindowText ( hWnd, strText, nMaxLen )
Window text is the title of a form window, dialog box, table window, radio button, check box, background
text, or push button. For a data field, multiline text field, or table window column, window text is the field
value in string form, regardless of the object's data type.
Return Value nLength is a number that indicates the length of strText. nLength is zero (0) if the
window has no text.
SalHideWindow
Syntax bOk = SalHideWindow ( hWndToHide )
This function does not destroy the window; it only makes the window invisible.
Parameters hWndToHide Window Handle. The handle (or name) of a window to hide.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalHideWindowAndLabel
Syntax bOk = SalHideWindowAndLabel ( hWndToHide )
A label is the background text that immediately precedes the window in the outline. This function does
Parameters hWndToHide Window Handle. The handle (or name) of a window to hide.
Return Value bOk is TRUE if the previous state of the window was visible and FALSE if it was
hidden. Use this information to hide many windows without first checking that they are visible. When you
restore them to their original state at a later point in time, the return lets you make visible only those
windows that were previously visible.
SalHStringToNumber
Syntax nHString = SalHStringToNumber ( strString )
Description Converts a string handle to a number so you can pass it as a message parameter.
Note: You must pass a string handle as the lParam parameter because the value is too large to fit in the wParam.
Parameters strString String. The string whose handle you want to change to a number.
Return Value nHString is a number that represents the converted string handle.
SalInvalidateWindow
Syntax bOk = SalInvalidateWindow ( hWndToPaint )
Parameters hWndToPaint Window Handle. The handle (or name) of a window to repaint.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalIsButtonChecked
Syntax bIsSet = SalIsButtonChecked ( hWnd )
Parameters hWnd Window Handle. The handle (or name) of a radio button or check box.
Return Value bIsSet is TRUE if hWnd is set or checked and FALSE otherwise.
SalIsNull
Syntax bNull = SalIsNull ( hWndIsNull )
Description Verifies whether a data field, multiline text field, or table window column is null or empty.
Parameters hWndIsNull Window Handle. The handle (or name) of a data field, multiline text
field, or table window column.
Return Value bNull is TRUE if hWndIsNull is null or empty, and FALSE otherwise.
Example On SAM_Validate
If SalIsNull ( dfDateTime )
Call SalMessageBox ( 'You must enter a value',
'Validate Error', MB_Ok )
Return VALIDATE_Cancel
SalIsValidDateTime
Syntax bOk = SalIsValidDateTime ( hWndField )
Description Verifies whether a data field, multiline text field, or table window column contains a valid date/time
value. For multiline text fields, the date/time value must be the only item in the field.
Parameters hWndField Window Handle. The handle (or name) of a data field, multiline text
field, or table window column.
Return Value bOk is TRUE if hWndField contains a valid date/time value and FALSE otherwise.
Example On SAM_Validate
If NOT SalIsValidDateTime ( dfDateTime )
SalIsValidDecimal
Syntax bOk = SalIsValidDecimal ( hWndField, nPrecision, nScale )
Description Verifies whether a data field, multiline text field, or table window column contains a valid decimal value.
For multiline text fields, the decimal value must be the only item in the field.
Parameters hWndField Window Handle. The handle (or name) of a data field, multiline text
field, or table window column.
nScale Number. The number of digits to the right of the decimal point.
Return Value bOk is TRUE if hWndField contains a number of the specified precision and scale,
and FALSE if hWndField's value does not match the parameter specifications.
Example On SAM_Validate
If NOT SalIsValidDecimal ( dfDecimal, 5, 2 )
Call SalMessageBox ( 'Invalid decimal value', 'Validate
SalIsValidInteger
Syntax bOk = SalIsValidInteger ( hWndField )
Description Verifies whether a data field, multiline text field, or table window column contains a valid integer value. For
multiline text fields, the integer value must be the only item in the field.
Parameters hWndField Window Handle. The handle (or name) of a data field, multiline text
field, or table window column.
Return Value bOk is TRUE if hWndField contains a valid integer value and FALSE if the number is
a fraction, decimal, or any other invalid integer value.
Example On SAM_Validate
If NOT SalIsValidInteger ( dfInteger)
Call SalMessageBox ( 'Invalid integer value', 'Validate
Description Verifies whether a data field, multiline text field, or table window column contains a valid numeric value.
Valid numbers are integers or floating point numbers, negative and positive. For multiline text fields, the
numeric value must be the only item in the field.
Parameters hWndField Window Handle. The handle (or name) of a data field, multiline text
field, or table window column.
Return Value bOk is TRUE if hWndField contains a valid SQLBase number and FALSE otherwise.
Example On SAM_Validate
! Examples of valid numbers: 100, 100.123, -100 If NOT SalIsValidNumber
( dfNumber)
Call SalMessageBox ( 'Invalid number value', 'Validate
Error', MB_Ok )
SalIsWindowEnabled
Syntax bEnabled = SalIsWindowEnabled ( hWndEnabled )
Description Determines whether a window is enabled for mouse and keyboard input.
Return Value bOk is TRUE if hWndEnabled is enabled and FALSE if hWndEnabled is not enabled
or is not a valid handle.
SalIsWindowVisible
Syntax bOk = SalIsWindowVisible ( hWndVisible )
Parameters hWndVisible Window Handle. The handle (or name) of a window. Create a window first
before using a window template as a parameter.
Return Value bOk is TRUE if the window is visible and FALSE otherwise.
SalListAdd
Syntax nIndex = SalListAdd ( hWndList, strName )
If the list box is sorted (the default), Centura inserts the string into the list in the appropriate place. If the list
box is not sorted, Centura adds the string to the end of the list box. Centura uses ANSI ascending order in
the sort.
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
Return Value nIndex is the index of the new list box entry. SalListAdd returns LB_Err on an error
and LB_ErrSpace if there is insufficient memory to store the new string.
SalListClear
Syntax bOk = SalListClear ( hWndList )
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
Return Value nRemaining is the number of rows remaining in the list box or combo box if the
function succeeds. SalListDelete returns LB_Err if an error occurs.
SalListFiles
Syntax bOk = SalListFiles ( hWndList, hWndPath, strPathName, nFlags )
Description Populates a list box or combo box with a directory of files. You can create the same kinds of dialog boxes
as those displayed by items of the Windows File menu.
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
hWndPath Window Handle. The handle (or name) of the data field that displays the
current directory and drive of the files listed in hWndList.
strPathName Receive String. The path name of the directory whose files are listed. You must
specify a field name or variable; you cannot specify a string constant as a receive
parameter.
nFlags Number. The type of file access. You can combine FA_* constants with
the OR (|) operator to create this value.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalListGetMultiSelect
Syntax bOk = SalListGetMultiSelect ( hWndList, nSelectedArray )
Description Returns an array of index numbers of selected list box entries. Use the SalListQueryMultiCount
function to return the number of selected list box entries.
Parameters hWndList Window Handle. The handle (or name) of a list box.
Return Value bOk is TRUE if the function succeeds and FALSE if hWndList or nSelectedArray are
not valid, or if no list box entries are selected.
SalListInsert
Syntax nIndex = SalListInsert ( hWndList, nIndex, strAdd )
Description Inserts an entry into a list box or combo box at a specified position.
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
nIndex Number. The position at which to insert the row. A value of -1 adds the entry
to the end of the list box or combo box.
Return Value nIndex is the index of the new entry. SalListInsert returns LB_Err on an error and
LB_ErrSpace if there is insufficient memory to store the new string.
SalListPopulate
Syntax bOk = SalListPopulate ( hWndList, hSql, strSelect )
Description Populates a list box or combo box with a result set. SalListPopulate overrides any settings made with
SalListSetTabs.
If the SELECT statement returns data from multiple columns, each column's data
displayed in a list box is separated by tabs. However, due to a Microsoft Windows limitation, each
column's data displayed in a combo box is separated by a single '|'
Parameters hWndList Window Handle. The handle (or name) of the list box or combo box to populate.
The SELECT statement can contain bind variables, but it cannot contain
INTO variables.
Return Value bOk is TRUE if the function succeeds and FALSE if any of the parameters are invalid
or if strSelect contains INTO variables.
Example On SAM_Click
Call SalListPopulate ( lbExample, hSql, 'select
name, trainer, room ' || 'from guest_roster' )
SalListQueryCount
Syntax nEntries = SalListQueryCount ( hWndList )
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
Return Value nEntries is the number of entries in hWndList. SalListQueryCount returns LB_Er if
an error occurs.
SalListQueryFile
Syntax bDirectory = SalListQueryFile ( hWndList, strFileName )
Description Fetches the selected directory or file name from a list box or combo box.
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
Return Value bDirectory is TRUE if strFileName is the name of a directory and FALSE if it is the
name of a file.
SalListQueryMultiCount
Syntax nSelected = SalListQueryMultiCount ( hWndList )
Description Returns the number of selected entries in a multiple-selection list box. Specify single- or
Parameters hWndList Window Handle. The handle (or name) of a multiple-selection list box.
Return Value nSelected is the number of selected entries in hWndList if the function succeeds.
nSelected equals LB_Err if hWndList is a single-selection list box or is not a valid handle.
SalListQuerySelection
Syntax nIndex = SalListQuerySelection ( hWndList )
Description Returns the index of the selected entry in a combo box or single-selection list box. Specify single- or
Note: For an example of getting a list of selected entries in a multiple-selection list box, see SalListQueryState.
Parameters hWndList Window Handle. The handle (or name) of a combo box or
single-selection list box.
SalListQueryState
Syntax bSelected = SalListQueryState ( hWndList, nIndex )
Description Determines whether the specified list box or combo box entry is selected.
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
nIndex Number. The index of the list box or combo box entry.
Return Value bSelected is TRUE if the nIndex entry is selected and FALSE if the entry is not
selected or an error occurs.
SalListQueryText or SalListQueryTextX
Syntax nLength = SalListQueryText ( hWndList, nIndex, strText )
or
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
nIndex Number. The index of the list box or combo box entry.
Return Value strText is the fetched list box or combo box entry.
SalListQueryTextLength
Syntax nLength = SalListQueryTextLength ( hWndList, nIndex )
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
nIndex Number. The index of the list box or combo box entry.
Return Value nLength is the length of the string. SalListQueryTextLength returns LB_Err if an
error occurs.
SalListQueryTextX
Syntax strText = SalListQueryTextX ( hWndList, nIndex )
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
nIndex Number. The index of the list box or combo box entry.
Return Value nLength is the length of strText. SalListQueryText returns LB_Err if nIndex is
invalid.
SalListRedraw
Syntax bOk = SalListRedraw ( hWndList, bRedraw )
Description Redraws entries in a list box or combo box, or prevents them from being redrawn. For example, use
SalListRedraw when populating a list box or combo box to prevent the contents from being redrawn after
adding each entry. When Centura finishes populating it, use this function to redraw the list box or combo
box .
Parameters hWndList Window Handle. The handle (or name) of a list box or combo box.
Example On SAM_Click
Call SalListRedraw ( lbList, FALSE )
SalListSelectString
Syntax nIndex = SalListSelectString ( hWndList, nIndexStart, strText )
Description Finds and selects a combo box or single-selection list box entry. Specify
SalListSelectString uses search wraps. For example, if Centura starts searching for a string in the middle of
a list box and reaches the end of the list box without finding the string, Centura wraps the search to the
beginning of the list box. It continues the search until it reaches the middle of the list box where it started the
search.
Parameters hWndList Window Handle. The handle (or name) of a combo box or
single-selection list box.
nIndexStart Number. The index at which to start the search. The search begins at row
nIndexStart + 1.
Return Value nIndex is the index of the selected string. SalListSelectString returns LB_Err if an
error occurs or if hWndList is a multiple-selection list box.
SalListSetMultiSelect
Syntax bOk = SalListSetMultiSelect ( hWndList, nIndex, bSelect )
Description Selects or deselects a combo box or multiple-selection list box entry. Specify single- or
Parameters hWndList Window Handle. The handle (or name) of a combo box or
multiple-selection list box.
nIndex Number. The index of the entry to select or deselect. If you specify -1,
Centura selects or deselects all list box or combo box entries.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalListSetSelect
Syntax bOk = SalListSetSelect ( hWndList, nIndex )
Description Selects or deselects a combo box or single-selection list box entry. Specify single-
Parameters hWndList Window Handle. The handle (or name) of a combo box or
single-selection list box.
nIndex Number. The index of the entry to select. If you specify -1, Centura
deselects the entry.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails. bOk is equal to LB_Err if
an error occurs.
SalListSetTabs
Syntax bOk = SalListSetTabs ( hWndList, nArrayTabStops )
Description Sets tabs in a list box. List boxes use tabs to align columns of data. You need to set tabs when you are
using a proportional font. SalListPopulate overrides any settings made with SalListSetTabs.
Parameters hWndList Window Handle. The handle (or name) of a list box.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
nTabStops[0] = 2 Set
( hWndItem, nTabStops )
SalLoadApp
Syntax bOk = SalLoadApp ( strAppName, strParameters )
See the SAL (Centura Application Language) chapter of the Centura Developer's
Reference for detailed information about command line arguments.
Return Value bOk is TRUE if the function succeeds and FALSE if Centura cannot find the
application or cannot start it.
Example On SAM_AppStartup
Call SalLoadApp ( ' DBWINDOW.EXE','' )
SalLoadAppAndWait
Syntax bOk = SalLoadAppAndWait ( strAppName, nMode, nRet )
Description Starts an application, then waits for it to exit before returning control to the original application.
Parameters strAppName String. The name of the application to start, separated from command line
arguments with a space. See the SAL chapter in the
Centura Developer’s Reference for
information about command line arguments.
nMode Number. The show mode. Specify any of these Window_* constants:
Window_Maximized
Window_Minimized
Window_Normal
Window_NotVisible
nRet Receive Number. The return status. If the function succeeds (bOk is TRUE),
nRet is the exit status of the invoked application. A zero exit status usually
means successful
execution. If bOk is TRUE, but the invoked application exits before entering a
message loop, its exit status is not available to Centura. In this case, nRet is
zero as though the program exited with a zero exit status.
(‘DBWindow.EXE’, WINDOW_NORMAL,
NRECUSTATUS)
Description This function changes the behavior of the Enter key from executing the default button on a window to
moving the focus to the next field. This function takes one parameter (TRUE or FALSE) to enable or
disable this action.
If TRUE, the Enter key shifts the focus to the next editable object.
If FALSE (default), the Enter key executes the default push button on the
form window or dialog box.
Return Value bOk is TRUE if the function succeeds and FALSE if you do not specify a Boolean
value.
SalMDIArrangeIcons
Syntax bOk = SalMDIArrangeIcons ( hWndMDI )
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalMDICascade
Syntax bOk = SalMDICascade ( hWndMDI )
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalMDITile
Syntax bOk = SalMDITile ( hWndMDI, bPosition )
Description Tiles all non-iconized child windows of an MDI window. Windows that are not sizable will not be
tiled.
bPosition Boolean. How to tile the child windows. If TRUE, tile the windows
vertically; if FALSE, tile the windows horizontally.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalMessageBeep
Syntax bOk = SalMessageBeep ( nAlertLevel )
Description Plays a waveform sound that corresponds to a given system alert level defined in the [sounds] section of
WIN.INI. A user can set the sound for each alert level with the sounds application in the Control Panel.
MB_Ok
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Description Displays a message box and returns a number that indicates the user's response. You can customize
the message box push buttons and icons. The active parent window, whose value is hWndForm,
Parameters strText String. The message text. You can enter multiple lines of text by pressing
CTRL-ENTER to start a new line.
Create a style by combining style option constants using the OR (|) operator.
You can combine at most one constant from each component. A style has
four components:
1. Push buttons
3. A default button
MB_AbortRetryIgnore
MB_Ok(default)
MB_OkCancel
MB_RetryCancel
MB_YesNo
MB_YesNoCancel Icon
Style Constants
MB_IconAsterisk
MB_IconExclamation
MB_IconHand
MB_IconQuestion
MB_IconStop
Response Button Style Constants
MB_DefButton1
MB_DefButton2
MB_DefButton3
MB_NoFocus
System Style Constants
MB_ApplModal (default)
MB_SystemModal
Return Value nResult is the value of the push button the user clicks.
This function accepts a string or a template as the first parameter. When you pass a string, you cannot
also pass window parameters.
You cannot use receive window parameters as receive function arguments. You can use a temporary
variable as the function argument and then assign the temporary variable to the receive function
parameter.
A modal dialog box disables its owner window. A system modal dialog box disables the entire Windows
system. SalEndDialog destroys the modal dialog box and enables all windows that were disabled.
SalModalDialog can pass information to the dialog box by accepting a variable number of parameters. The
data types of these parameters must match the parameter data types of the dialog box being created. You
define parameters for the dialog box in the Window Parameters section of the application outline.
You can use window parameters to return information from the window being created by using a receive
type. However, you can initialize receive window parameters only with variables. This means that you
cannot pass a data field or any other window object to a window parameter that was defined as a receive
type.
Parameters tDlgBoxToCreate Template or String. The name of the modal dialog box to create.
NOTE: If you specify a string value, you cannot pass window parameter
arguments (Parm1, Parm2, ...).
hWndOwner Window Handle. The handle (or name) of the owner window. Use
hWndNULL for a dialog box that does not have an owner.
Parm1 Any Centura data type. The (optional) first of a variable number of
window parameters.
Parm2 Any Centura data type. The (optional) second of a variable number of
window parameters.
Return Value nReturn is the value specified in the second parameter of SalEndDialog
(hWndOwner). nReturn is equal to -1 if the dialog box is not created.
SalModalDialogFromStr
Syntax nReturn = SalModalDialogFromStr ( tDlgBoxToCreate, hWndOwner, Parm1, Parm2, ... )
Description Creates a modal dialog box. This function is useful with internal functions that expect to receive a dialog
box name in a string parameter.
A modal dialog box disables its owner window. A system modal dialog box disables the entire Windows
system. SalEndDialog destroys a modal dialog box and enables all windows that were disabled.
Parameters strName String. The name of the modal dialog box to create.
hWndOwner Window Handle. The handle (or name) of the owner window. Use hWndNUL
for dialog boxes that do not have owners.
Parm1 Any Centura data type. The (optional) first of a variable number of
window parameters.
Parm2 Any Centura data type. The (optional) second of a variable number of
window parameters.
Return Value nReturn is the value specified in the second parameter of SalEndDialog
(hWndOwner). nReturn is equal to -1 if the dialog box is not created.
SalMoveWindow
Syntax bOk = SalMoveWindow ( hWndToMove, nXOffset, nYOffset )
Description Moves a window a given number of form units on the X and Y axes relative to its current position.
Parameters hWndToMove Window Handle. The handle (or name) of the window to move.
nXOffset Number. The number of form units to move the window on the X axis.
nYOffset Number. The number of form units to move the window on the Y axis.
Return Value bOk is TRUE if the function succeeds, and FALSE if hWndToMove is invalid.
SalNumberAbs
Syntax nNum = SalNumberAbs ( nValue )
Parameter s nValue Number. The number whose absolute value you want.
Example On SAM_Click
Set nNum1 = SalNumberAbs ( - 12 )
SalNumberArcCos
Syntax nArcCos = SalNumberArcCos ( nValue )
Description Computes the arccosine of a value in the range 0 to 1. The value's domain is -1 to 1.
Return Value nArcCos is the arccosine of nValue. It is zero (0) if nValue is less than -1 or greater
than 1.
Example On SAM_Click
Set nNum1 = SalNumberArcCos ( 1 )
SalNumberArcSin
Syntax nArcSin = SalNumberArcSin ( nValue )
Return Value nArcSin is the arcsine of nValue. nArcSin is zero (0) if nValue is less than -1 or
greater than 1.
Example On SAM_Click
Set nNum1 = SalNumberArcSin (1)
SalNumberArcTan
Syntax nArcTan = SalNumberArcTan ( nValue )
Example On SAM_Click
Set nNum1 = SalNumberArcTan ( 1 )
SalNumberArcTan2
Syntax nArcTan2 = SalNumberArcTan2 ( nValueY, nValueX )
Description Computes the arctangent of two values. This function uses the signs of both parameters to
determine the quadrant of the return value.
Parameters nValueY Number. One of two values whose arctangent you want.
nValueX Number. The other of two values whose arctangent you want.
Return Value nArcTan2 is the arctangent of nValueY and nValueX. nArcTan2 is in the range -1/2 to
1/2.
Example On SAM_Click
Set nNum1 = SalNumberArcTan2 ( 1, 0 )
SalNumberCos
Syntax nCos = SalNumberCos ( nAngle )
Description Computes an angle's cosine. You must specify the angle in terms of radians.
Parameters nAngle Number. The value of the angle whose cosine you want.
Return Value nCos is the cosine of nAngle. If the angle is large, nCos can reflect a partial loss of
significance. If the angle is so large that significance is totally lost, SalNumberCos returns zero (0).
Example On SAM_Click
Set nNum1 = SalNumberCos ( 0 )
Description Computes an angle's hyperbolic cosine. You must specify the angle in terms of radians.
Parameters nAngle Number. The value of the angle whose hyperbolic cosine you want.
Return Value nCosH is the hyperbolic cosine of nAngle. If the return value is too large, nCosH
equals zero (0).
Example On SAM_Click
Set nNum1 = SalNumberCosH ( 0 )
SalNumberExponent
Syntax nNumExp = SalNumberExponent ( nValue )
Parameters nValue Number. The value whose exponential function you want.
Return Value nNumExp is the result of 'e' to the power of nValue. When there is an underflow or
overflow, nNumExp is equal to zero (0).
Example On SAM_Click
Set nNumExp = SalNumberExponent ( 2.302585093 )
SalNumberHigh
Syntax nHi = SalNumberHigh ( nValue )
Parameters nValue Number. The number whose high-order word value you want. Centura treats
nValue as an unsigned 32-bit number.
Example On SAM_Click
Set nHi = SalNumberHigh ( 0xffffaaaa )
SalNumberHypot
Syntax nHypotenuse = SalNumberHypot ( nX, nY )
Description Computes the length of the hypotenuse of a right triangle, given the lengths of the other two sides.
Return Value nHypotenuse is the length of the hypotenuse of a right triangle. If the computation of
the hypotenuse results in an overflow, nHypotenuse is equal to zero (0).
Example On SAM_Click
Set nHypotenuse = SalNumberHypot ( 3, 4 )
SalNumberLog
Syntax nLog = SalNumberLog ( nValue )
Parameters nValue Number. The number whose natural logarithm you want.
Return Value nLog is the natural logarithm of nValue. If nValue is negative or 0, nLog is equal to
zero (0).
Example On SAM_Click
Set nLog = SalNumberLog ( 1000 )
SalNumberLogBase10
Syntax nLogBase10 = SalNumberLogBase10 ( nValue )
Parameters nValue Number. The number whose base -10 logarithm you want.
Example On SAM_Click
Set nLogBase10 = SalNumberLogBase10 ( 1000 )
Parameters nValue Number. The number whose low-order word value you want. Centura treats
nValue as an unsigned 32-bit number.
Example On SAM_Click
Set nLo = SalNumberLow ( 0xffffaaaa )
SalNumberMax
Syntax nNumMax = SalNumberMax ( nVal1, nVal2 )
Example On SAM_Click
Set nNumMax = SalNumberMax ( 1765.2, -2 )
SalNumberMin
Syntax nNumMin = SalNumberMin ( nVal1, nVal2 )
Example On SAM_Click
Set nNumMin = SalNumberMin ( 1765.2, -2 )
SalNumberMod
Syntax nModulo = SalNumberMod ( nNumber, nNumberMod )
Description Returns a number's modulo. This function divides nNumber by nNumberMod and returns the
remainder.
Parameter
nNumber Number. The number to divide.
Example On SAM_Click
Set nNumber = SalNumberMod ( 5, 2 )
SalNumberPi
Syntax nNumPi = SalNumberPi ( nValue )
Example On SAM_Click
Set nNumPi = SalNumberSin ( SalNumberPi ( 1 ) /2 )
SalNumberPower
Syntax nNumPower = SalNumberPower ( nX, nY )
Description Computes nX raised to the power of nY. This function does not recognize integral, floating-point values
greater than 2 to the 64th power, such as 1.0E100.
Return Value nNumPower is equal to nX raised to the nYth power, with the following conditions:
3. If both nX and nY are zero (0), or if nX is negative and nY is not a whole number, nNumPower is
equal to zero (0), meaning that an error occurred.
Example On SAM_Click
Set nNumPow = SalNumberPower ( 2, 3 )
SalNumberRandInit
Syntax bOk = SalNumberRandInit ( nSeed )
Description Sets the starting point for generating a series of pseudo-random numbers using SalNumberRandom.
Use SalNumberRandInit when you want to generate the same set of pseudo-random numbers over and
over again, for example, when doing reproducible experiments. Call SalNumberRandInit followed by
numerous calls to SalNumberRandom. To repeat the random number series, call SalNumberRandInit
again, specify the same seed value, and follow with numerous calls to SalNumberRandom.
Parameters nSeed Number. The starting point. A whole number in the range of 0 to 32767.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_Click
Call SalNumberRandInit ( 12 )
SalNumberRandom
Syntax nRandomNum = SalNumberRandom ( )
Description Generates a pseudo-random number. The numbers generated by this function are integers (whole
numbers) in the range 0 to 32767 (0 to 0x7FFF).
Parameters No parameters.
Example On SAM_Click
Call SalNumberRandInit ( 12 ) Set nRandNum = SalNumberRandom
()
SalNumberRound
Syntax nResult = SalNumberRound ( nNumber )
If the fractional part of a number is greater than or equal to .5, Centura rounds the number up. For
example, the number 124.33 returns 124; the number 124.56 returns
125.
Example On SAM_Click
Set nNumber = SalNumberRound ( 124.5 )
SalNumberSin
Syntax nSin = SalNumberSin ( nAngle )
Description Computes an angle's sine. You must specify the angle in terms of radians.
Parameters nAngle Number. The value of the angle whose sine you want.
Return Value nSin is the sine of nAngle. If the angle is large, nSin can reflect a partial loss of
significance. If the angle is so large that significance is totally lost, nSin is equal to zero (0).
Example On SAM_Click
Set nNum = SalNumberSin ( SalNumberPi ( 1 ) /2 )
SalNumberSinH
Syntax nSinH = SalNumberSinH ( nAngle )
Description Computes an angle's hyperbolic sine. You must specify the angle in terms of radians.
Parameters nAngle Number. The value of the angle whose hyperbolic sine you want.
Return Value nSinH is the hyperbolic sine of nAngle. If the angle is too large, nSinH is equal to
zero (0).
Example On SAM_Click
SalNumberSqrt
Syntax nSqrt = SalNumberSqrt ( nValue )
Parameters nValue Number. The number whose square root you want.
Return Value nSqrt is the square root of nValue. If nValue is negative, it is out of the domain of
valid values and nSqrt is equal to zero (0).
Example On SAM_Click
Set nSqrt = SalNumberSqrt ( 36 )
SalNumberTan
Syntax nTan = SalNumberTan ( nAngle )
Description Computes an angle's tangent. You must specify the angle in terms of radians.
Parameters nAngle Number. The value of the angle whose tangent you want.
Return Value nTan is the tangent of nAngle. If the angle is large, nTan can reflect a partial loss of
significance. If the angle is so large that significance is totally lost, nTan is equal to zero (0).
Example On SAM_Click
Set nNum = SalNumberTan ( SalNumberPi ( 1 ) / 4 ) )
SalNumberTanH
Syntax nTanH = SalNumberTanH ( nAngle )
Description Computes an angle's hyperbolic tangent. You must specify the angle in terms of radians.
Parameters nAngle Number. The value of the angle whose hyperbolic tangent you want.
Return Value nTanH is the hyperbolic tangent of nAngle. If the angle is large, nTanH can reflect a
partial loss of significance. If the angle is so large that significance is totally lost, nTanH is equal to
zero (0).
Example On SAM_Click
Set nNum = SalNumberTanH ( 0 )
SalNumberToChar
Syntax strChar = SalNumberToChar ( nNumber )
Example On SAM_Click
Set df2 = SalNumberToChar ( df1 )
SalNumberToHString
Syntax strString = SalNumberToHString ( nHString )
Parameters nHString Number. The numeric value of the string handle to convert.
Return Value strString is a string handle that represents the number converted.
Example On SAM_Click
Set strString = SalNumberToHString ( lParam )
Set nBuffLen = SalStrGetBufferLength (strString)
SalNumberToStr
Syntax nLength = SalNumberToStr ( nNumber, nDecimalPlaces, strString )
Return Value nLength is the length of strString, including the decimal point.
Example On SAM_Click
Set nLength = SalNumberToStr ( 124.5, 1, strString )
SalNumberToStrX
Syntax strString = SalNumberToStrX ( nNumber, nDecimalPlaces)
Return Value nLength is the length of strString, including the decimal point.
Example On SAM_Click
Set df2 = SalNumberToStrX ( df1, 2 )
SalNumberToWindowHandle
Syntax hWnd = SalNumberToWindowHandle ( nWnd )
SalNumberTruncate
Syntax nResult = SalNumberTruncate ( nNumber, nPrecision, nScale )
Parameters nNumber Number. The number to truncate, starting with the leftmost.
nPrecision Number. The number of digits to display, starting with the leftmost.
nScale Number. The number of digits to the right of the decimal point. The nPrecision
parameter must be large enough to hold the number of digits that you specify
in this parameter.
SalParentWindow
Syntax hWndParent = SalParentWindow ( hWnd )
Description Returns the handle of an object’s parent window. The following table shows the SalParentWindow
behavior with tool bars and MDI windows:
Tool bar child in an MDI hWndItem Handle of the MDI window that
window. contains it (hWndMDI).
Child table window in a tool hWndForm Handle of the top-level object that
bar. contains it (hWndForm is the handle of
the table window).
Parameters hWnd Window Handle. The handle (or name) of the object whose parent window
handle you want.
Return Value hWndParent is the parent window handle of hWnd. If hWnd is a top-level window,
hWndParent is the window handle of the owner window, as passed to
SalCreateWindow, otherwise hWndParent is equal to hWndNull.
SalPicClear
Syntax bOk = SalPicClear ( hWndToClear )
Return Value bOk is TRUE if the function succeeds and FALSE if hWnd is not a valid picture.
SalPicGetDescription
Syntax nLength = SalPicGetDescription ( hWndPict, strDesc, nMaxLen )
Gupta:PCX Paintbrush
SalPicGetString
Syntax nLength = SalPicGetString ( hWndPict, nFormat, strPict )
PIC_FormatBitmap
PIC_FormatIcon
PIC_FormatObject
Return Value nLength is the length (in bytes) of strPict. If the format is not available, nLength is
equal to zero (0).
SalPicSet
Syntax bOk = SalPicSet ( hWndPic, tResource, nFormat )
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalPicSetFile
Syntax bOk = SalPicSetFile ( hWndPict, strFileName )
strFileName String. The name of the file whose contents are to be inserted into hWndPict.
Centura derives a picture's file type from the file extension. The file extension of
a bitmap must be .BMP; the file extension of an icon must be .ICO.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalPicSetFit
Syntax bOk = SalPicSetFit ( hWndPict, nFit, nScaleWidth, nScaleHeight )
PIC_FitBestFit PIC_FitScale
PIC_FitSizeToFit
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalPicSetString
Syntax bOk = SalPicSetString ( hWnd, nFormat, strPicture )
strPicture String. A memory image of a picture file. You can use SalFileRead to read
a bitmap file into a string. You can also SELECT a long varchar database
column that contains a bitmap or icon file into a string.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Description Computes the number of Centura form units based on the number of pixels. Centura form units is a unit of
measurement used by functions that move and position objects. Form units are computed by Centura using
physical units (pixels) in conjunction with a window's font sizes.
Parameters hWnd Window Handle. The handle (or name) of a window whose form units you
want to compute.
bVertical Boolean. If the pixels are on the X axis, set this parameter to FALSE. If the
pixels are on the Y axis, set this parameter to TRUE.
Return Value nFormUnits is the number of form units returned if the function call is successful.
nFormUnits is equal to zero (0) if hWnd is invalid.
SalPostMsg
Syntax bOk = SalPostMsg ( hWndReceiver, nMsg, nMywParam, nMylParam )
Description Posts the specified message to a window by adding nMsg to hWndReceiver's message queue.
Parameters hWndReceiver Window Handle. The handle (or name) of the window receiving the
message.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalPrtExtractRect
Syntax bOk = SalPrtExtractRect ( nMylParam, nLeft, nTop, nRight, nBottom )
Description Extracts the currently printing rectangle from the SAM_Print message's lParam parameter.
nLeft Receive Number. The position on the X axis of the rectangle's left side.
nTop Receive Number. The position on the Y axis of the top of the rectangle.
nRight Receive Number. The position on the X axis of the rectangle's right side.
nBottom Receive Number. The position on the Y axis of the bottom of the rectangle.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_Print
Call SalPrtExtractRect ( nMylParam, nLeft, nTop, nRight,
nBottom )
SalPrtGetDefault
Syntax bOk = SalPrtGetDefault ( strDevice, strDriver, strPort )
Description Returns the default device (printer), the default driver, and the default port.
Return Value bOk is TRUE if the function call is successful in getting the default values, and
FALSE otherwise.
Description Gets the value of a print parameter. The print parameters are a set of global variables which are initialized
to default values and can be set using SalPrtSetParmNum, retrieved using SalPrtGetParmNum or
reinitialized using SalPrtSetParmDefaults.
Parameters nParm Number. The print parameter whose value you want; one of the PRT_*
constants.
nValue Receive Number. The print parameter's value. For boolean parameters,
nValue is TRUE or FALSE.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_Create
Call SalPrtGetParmNum ( PRT_nDraftMode, nPrtValue) If nPrtValue
SalPrtPrintForm
Syntax bOk = SalPrtPrintForm ( hWndForm )
Description Prints a form window, table window, or dialog box, including its contents and row header flags. If a form
window or dialog box contains a child table window, list box or combo box, only the rows on screen print.
Lines, frames, and pictures print as well. Centura tries to print a window in the font displayed on screen.
For best results, use only those fonts supported by your printer.
If the window is wider or higher than the paper size, the window prints on as many pages as needed.
Parameters hWndForm Window Handle. The handle (or name) of the window to print.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalPrtSetDefault
Syntax bOk = SalPrtSetDefault ( strDevice, strDriver, strPort )
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Call SalPrtSetDefault
SalPrtSetParmDefaults
Syntax bOk = SalPrtSetParmDefaults ( )
Description Resets print parameters back to their default values. The print parameters are a set of global variables which
are initialized to default values and can be set using SalPrtSetParmNum, retrieved using SalPrtGetParmNum
or reinitialized using SalPrtSetParmDefaults. Number of copies: 1 Print in draft mode: FALSE Print all pages:
TRUE Print from page: 1 Print to page: 1 Left margin: 0 Top margin: 0
Parameters No parameters.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalPrtSetParmNum
Syntax bOk = SalPrtSetParmNum ( nParm, nValue )
Description Sets the value of a print parameter. The print parameters are a set of global variables which are initialized
to default values and can be set using SalPrtSetParmNum, retrieved using SalPrtGetParmNum or
reinitialized using SalPrtSetParmDefaults.
Parameters nParm Number. A constant that represents the parameter to set; one of the PRT_*
constants.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example If rbDraftMode
Call SalPrtSetParmNum ( PRT_nDraftMode,
TRUE)
SalPrtSetup
Syntax bOk = SalPrtSetup ( strDevice, strDriver, strPort, bActiveOnly )
Description Displays the Printer Setup dialog box that lets the user alter the printer setup. Initially, the current default
printer is displayed and the user may change the printer. SalPrtSetup returns the user's selections in the
Receive Strings.
bActiveOnly Boolean. Whether to display active and/or inactive printers: if TRUE, all
printers display and if FALSE, only active printers display.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalQueryFieldEdit
Syntax bSet = SalQueryFieldEdit ( hWndField )
Description Returns the setting of the Field Edit Flag for a data field, multiline field, combo box, table window's
context row cell, or picture.
The field edit flag is set whenever the user changes the value of a data field, multiline text field, or table
window column. For a picture, the field edit flag is set whenever an OLE server application is opened for
editing. The field edit flag is not set if you make the change with a Set statement or a fetch from the
database. This function does not clear the field edit flag of hWndField.
Parameters hWndField Window Handle. The handle (or name) of a data field, multiline field,
combo box table window column, or picture.
Return Value bSet is TRUE if hWndField's field edit flag is set and FALSE otherwise.
SalQuit
Syntax bOk = SalQuit ( )
If you are in user mode, Centura returns you to design mode. If the application running from
SQLRUN.EXE, it exits.
Parameters No parameters.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_Click
Call SalQuit ()
Description Closes a report window. Call this function when you want to close a report preview window.
Parameters hWndReport Window Handle. The handle (or name) of a report window.
Return Value bOk is TRUE if the function succeeds and FALSE if hWndReport is invalid.
SalReportCmd
Syntax bOk = SalReportCmd ( hWndReport, nCommand )
Description Sends a command to an open report window. Use SalReportCmd to control a window that displays a report.
When you call SalReportView, its second parameter contains the handle of the window in which the report
displays. The application creates that window. Use SalReportCmd to send commands that control the
window to ReportWindows. If SalReportView's second parameter is null, ReportWindows creates its own
window in which to display the report, and you cannot use SalReportCmd.
Parameters hWndReport Window Handle. The window handle (or name) of a report window.
nCommand Number. The command to send to the report. Possible values include any of
the RPT_Cmd* commands.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalReportCreate
Syntax bOk = SalReportCreate ( strTemplate, strVariables, strInputs, bDefaultReport, nError )
nError Receive Number. If an error occurs, this parameter is equal to one of the
RPT_Err* values.
If you call SalReportCreate ten times in a row, you will receive the following
error code: RPT_ErrMaxRps. In run mode at designtime, Centura always
displays a dialog box with an explanation if an error happens. For *.RUN and
* . EXE applications, Centura only displays an error dialog box if you set this
parameter to 1 before calling SalReportCreate.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails. If bOk is FALSE, nError
is a RPT_Err* value.
SalReportDlgOptions
Syntax bOk = SalReportDlgOptions ( hWndReport, strCaption, strLine1, strLine2, strDocName )
Description Sets the options for the report printing dialog box. Call this function after creating the report but before
printing begins. For example, you can call SalReportDlgOptions while processing the
SAM_ReportFetchInit message.
Parameters hWndReport Window Handle. The wParam of a SAM_Report* message that contains
the window handle.
strCaption String. The replacement text for the Print dialog box caption text.
strLine1 String. The replacement text for the first centered-text field.
strLine2 String. The replacement text for the second centered-text field.
strDocName String. The name of the document that Print Manager displays when the output
is spooled and waiting to print.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalReportGetDateTimeVar
Syntax bOk = SalReportGetDateTimeVar ( hWndReport, strVariable, dtValue )
Parameters hWndReport Window Handle. The handle (or name) of a report window.
Return Value bOk is TRUE if the function is successful, and FALSE otherwise.
SalReportGetNumberVar
Syntax bOk = SalReportGetNumberVar ( hWndReport, strVariable, nValue )
Parameters hWndReport Window Handle. The handle (or name) of a report window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalReportGetObjectVar
Syntax bOk = SalReportGetObjectVar ( hWndReport, strVariable, strValue )
Parameters hWndReport Window Handle. The handle (or name) of a report window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalReportGetStringVar
Syntax bOk = SalReportGetStringVar ( hWndReport, strVariable, strValue )
Parameters hWndReport Window Handle. The handle (or name) of a report window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
See Also
SalReportGetDateTimeVar
SalReportGetNumberVar
SalReportGetObjectVar
SalReportSetStringVar
Description Prints a report. This function is synchronous and does not return until the report has been formatted and
sent to Windows or Windows Print Manager for printing. SalReportPrint creates a minimized
ReportWindows window. A print status dialog box displays while printing. When this function completes,
ReportWindows automatically ends.
Note: This function establishes a dialog between ReportWindows and the application; the real work of reporting is in
processing the SAM_Report* messages which ReportWindows sends.
Centura sends data from an application to ReportWindows when the application returns TRUE in
SAM_ReportFetchNext processing. ReportWindows continues to send SAM_ReportFetchNext
messages until the application returns FALSE.
Parameters hWndFrm Window Handle. The handle (or name) of the application window that
processes SAM_Report* messages.
strInputs String. A comma-separated list of the report's input names. The contents of
this string are case-sensitive and must match the case of the input names
declared in the report template.
nOptions Number. You can combine two or more of these constants with the OR (|)
operator:
RPT_PrintAll
RPT_PrintDraft
RPT_PrintNoAbort
RPT_PrintNoErrors
RPT_PrintNoWarn
RPT_PrintRange
nFirstPage Number. The first page of the report (if nOptions includes
RPT_PrintRange).
nLastPage Number. The last page of the report (if nOptions includes
RPT_PrintRange).
nErr Receive Number. If this function succeeds, this parameter is zero. If an error
occurs, this parameter is one of the RPT_Err* values.
Note: If you call SalReportPrint ten times in a row, you will receive the following error code: RPT_ErrMaxRps.
Return Value The return value is reserved for future use and can be ignored. To detect if the
function succeeded, check nErr which is a RPT_Err* value. If successful, nErr is zero.
If you want to interact with the report window, interrogate wParam at SAM_ReportStart
and save that into the hWndReport variable.
SalReportPrintToFile
Syntax hWndRet = SalReportPrintToFile ( hWndFrm, strTemplate, strDestFile, strVariables, strInputs, nCopies,
nOptions, nFirstPage, nLastPage, bFormat, nErr )
This function is synchronous and does not return until the output report file is closed.
Parameters hWndFrm Window Handle. The handle (or name) of the application window that
processes the SAM_Report* messages.
strInputs String. A comma-separated list of the report's input names. The contents of
this string are case-sensitive and must match the case of the input names
declared in the report template.
nOptions Number. You can combine two or more of these constants with the OR (|)
operator: RPT_PrintAll RPT_PrintDraft RPT_PrintNoAbort RPT_PrintNoErrors
RPT_PrintNoWarn RPT_PrintRange
nFirstPage Number. The first page of the report (if nOptions includes
RPT_PrintRange).
nLastPage Number. The last page of the report (if nOptions includes
RPT_PrintRange).
nErr Receive Number. If this function succeeds, this parameter is zero. If an error
occurs, this parameter is one of the RPT_Err* values.
If you call SalReportPrintToFile ten times in a row, you will receive the
following error code: RPT_ErrMaxRps. In run mode at designtime, Centura
always displays a dialog box with an explanation if an error happens. For
*.RUN and
* . EXE applications, Centura only displays an error dialog box if you set this
parameter to 1 before calling SalReportPrintToFile.
Return Value The return value is reserved for future use and can be ignored. To detect if the
function succeeded, check nErr which is a RPT_Err* value. If successful, nErr is zero.
SalReportReset
Syntax bOk = SalReportReset ( hWndReport )
Description Re-populates the report window. This function re-sends the SAM_ReportFetchInit message, and one or
more SAM_ReportFetchNext messages to populate the report window with the new data.
Parameters hWndReport Window Handle. The handle (or name) of the report window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalReportSetDateTimeVar
Syntax bOk = SalReportSetDateTimeVar ( hWndReport, strVariable, dtValue )
Parameters hWndReport Window Handle. The handle (or name) of a report window.
strVariable String. The name of the variable whose value you want to set.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Parameters hWndReport Window Handle. The handle (or name) of a report window.
strVariable String. The name of the variable whose value you want to set.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Related Function
SalReportGetNumberVar
SalReportSetDateTimeVar
SalReportSetObjectVar
SalReportSetStringVar
SalReportSetObjectVar
Syntax bOk = SalReportSetObjectVar ( hWndReport, strVariable, strValue )
Parameters hWndReport Window Handle. The window of the report window handle.
strVariable String. The name of the variable whose value you want to set.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalReportSetStringVar
Syntax bOk = SalReportSetStringVar ( hWndReport, strVariable, strValue )
Parameters hWndReport Window Handle. The handle (or name) of a report window.
strVariable String. The name of the variable whose value you want to set.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalReportTableCreate
Syntax bOk = SalReportTableCreate ( strReport, hWndTbl, nError )
Description Creates a report template from the specified table window. The table window column names are the input
names to the report and their titles are the column names on the report. For a top-level table window, the
report's title is the same as the table window's title; for a child table window, the report does not have a title.
nError Receive Number. If an error occurs, this parameter is equal to one of the
RPT_Err* values.
Note: If you call SalReportTableCreate ten times in a row, you will receive the
following error code: RPT_ErrMaxRps. In run mode at designtime, Centura
always displays a dialog box with an explanation if an error happens. For
*.RUN and
* . EXE applications, Centura only displays an error dialog box if you set this
parameter to 1 before calling SalReportTableCreate.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalReportTablePrint
Syntax hWnd = SalReportTablePrint ( hWndTbl, strReport, nParamArray, nError )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nParamArray Number. An array you create containing information about the print job. The
array indexes are: RPT_PrintParamCopies RPT_PrintParamFirstPage
RPT_PrintParamLastPage RPT_PrintParamOptions
nError Receive Number. If an error occurs, this parameter is equal to one of the
RPT_Err* values.
If you call SalReportTablePrint ten times in a row, you will receive the
following error code: RPT_ErrMaxRps. In run mode at designtime, Centura
always displays a dialog box with an explanation if an error happens. For
*.RUN and
* . EXE applications, Centura only displays an error dialog box if you set this
parameter to 1 before calling SalReportTablePrint.
Return Value hWnd is the handle of the report window if the function succeeds.
SalReportTableView
Syntax hWnd = SalReportTableView ( hWndTbl, hWndDisplay, strReport, nError )
Description Displays, in preview mode, a report created from the specified table window.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
hWndDisplay Window Handle. The handle (or name) of a report display window. If null,
Centura creates a window in which you can preview the report.
nError Receive Number. If an error occurs, this parameter is equal to one of the
RPT_Err* constants.
If you call SalReportTableView ten times in a row, you will receive the
following error code: RPT_ErrMaxRps. In run mode at designtime, Centura
always displays a dialog box with an explanation if an error happens. For
*.RUN and
* . EXE applications, Centura only displays an error dialog box if you set this
parameter to 1 before calling SalReportTableView.
Return Value hWnd is the handle of the report window if the function succeeds.
SalReportView
Syntax hWndReport = SalReportView ( hWndFrm, hWndRptTemp, strTemplate, strVariables,
strInputs, nFlags )
Note: This function establishes a dialog between ReportWindows and the application; the real work of reporting is
done in trapping and handling the SAM_Report messages which ReportWindows sends.
If you are reporting on application variables, an array, or a file, your data is transmitted to the report
only if you return TRUE from the SAM_ReportFetchNext
Parameters hWndFrm Window Handle. The handle (or name) of the application window that
processes SAM_Report* messages.
hWndRptTemp Window Handle. An optional window handle (or name) to a custom report
template. If null, ReportWindows creates its own window in which it displays
the report.
strInputs String. A comma-separated list of the report's input names. The contents of
this string are case-sensitive and must match the case of the input names
declared in the report template.
nFlags Receive Number. Before you call this function, you can set this parameter to
one of the constants below to turn off the printer icon on the default report view
tool bar or turn off the tool bar completely:
If you call SalReportView ten times in a row, you will receive the following
error code: RPT_ErrMaxRps. In run mode at designtime, Centura always
displays a dialog box with an explanation if an error happens. For *.RUN and
* . EXE applications, Centura only displays an error dialog box if you set this
parameter to 1 before calling SalReportView.
Return Value hWndReport is the handle of the report window if the function succeeds. Centura
returns the window handle before ReportWindows displays the report.
SalScrollGetPos
Syntax bOk = SalScrollGetPos ( hWndsb, nPos )
Parameters hWndsb Window Handle. The handle (or name) of a vertical or horizontal
scroll bar.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalScrollGetRange
Syntax bOk = SalScrollGetRange ( hWndsb, nMin, nMax, nLine, nPage )
Description Gets a scroll bar's scroll range, line increment, and page increment.
Parameters hWndsb Window Handle. The handle (or name) of a vertical or horizontal
scroll bar.
nLine Receive Number. The line increment. The number of units the scroll bar
increments or decrements when the user clicks the scroll bar arrow.
nPage Receive Number. The page increment. The number of units the scroll bar
increments or decrements when the user clicks either side of the scroll bar's
scroll box.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Description Sets a scroll bar's position. This function is equivalent to using a Set statement to assign a value to the
scroll bar.
Parameters hWndsb Window Handle. The handle (or name) of a vertical or horizontal
scroll bar.
nPos Number. The scroll bar position. If this value is outside the scroll bar's range,
Centura sets the scroll bar position to the scroll range minimum or the scroll
range maximum, depending on whether nPos is below or above the range.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalScrollSetRange
Syntax bOk = SalScrollSetRange ( hWndsb, nMin, nMax, nLine, nPage )
Description Sets a scroll bar's range, line increment, and page increment. When the scroll
If the scroll bar's current position is outside the new range, its position changes to one within the new range.
The range of a scroll bar is -32,767 to 32,767.
Parameters hWndsb Window Handle. The handle (or name) of a vertical or horizontal
scroll bar.
nLine Number. The number of units to increment or decrement the scroll bar when
the user clicks the scroll bar arrow.
nPage Number. The number of units to increment or decrement the scroll bar when
the user clicks either side of the scroll box.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalSendClassMessage
Syntax nMsgReturn = SalSendClassMessage ( nMessage, nMywParam, nMylParam )
Description Invokes the message actions implemented or inherited by an object's class when called from either a
derived class or from an object that is an instance of a class.
Return Value nMsgReturn is the message return value. If the message has no return, nMsgReturn is
zero (0).
SalSendClassMessageNamed
Syntax nMsgReturn = SalSendClassMessageNamed ( tClassName, nMsg, nMywParam,
nMylParam )
Description Invokes the message actions implemented or inherited by an object's class when called from either a
derived class or from an object that is an instance of a class. Use this function instead of
SalSendClassMessage with a class that is the result of multiple inheritance. It lets you specify which base
class message action you want to execute.
tClassName must be a direct base class of the class from which this call is made.
Return Value nMsgReturn is the message return value. If the message has no return, nMsgReturn is
zero (0).
SalSendMsg
Syntax nMsgReturn = SalSendMsg ( hWnd, nMsg, nMywParam, nMylParam )
Description Sends the specified message to a window. SalSendMsg does not return until the processing for the
message is complete.
Return Value nMsgReturn is the message return value. If the message has no return, nMsgReturn is
zero (0).
SalSendMsgToChildren
Syntax bSent = SalSendMsgToChildren ( hWnd, nMsg, nMywParam, nMylParam )
Description Sends a message to all child items of a form window, dialog box, table window, or MDI window.
Parameters hWnd Window Handle. The handle (or name) of a form window, dialog box,
table window, or MDI window.
Return Value bSent is TRUE if the function succeeds and FALSE if it fails.
SalSendValidateMsg
Syntax nStatus = SalSendValidateMsg ( )
Description Sends a SAM_Validate message to the object with the focus data field, multiline field, or table
window column if it was edited and sets the wParam and lParam message variables to zero (0).
Call this function to force field validation before processing a menu pick. Centura does not
automatically send SAM_Validate message on a menu pick.
Parameters Np parameters.
Return Value nStatus is returned by the object's message actions for the SAM_Validate message:
VALIDATE_Cancel
VALIDATE_Ok
VALIDATE_OkClearFlag
SalSetDefButton
Syntax bOk = SalSetDefButton ( hWndButton )
Description Sets the default push button of a form window or dialog box. When this function returns, the default push
button gets the focus only if the focus was on one of the push buttons before you called SalSetDefButton.
Parameters hWndButton Window Handle. The handle (or name) of the default push button.
Return Value bOk is TRUE if the function succeeds and FALSE if hWndButton is not a valid
button.
Description Sets or clears the field edit flag for an editable data field, combo box, multiline text field, table window
column, or picture.
The Field Edit Flag is set whenever the user changes the value of a data field, multiline field, combo box or
table window column. For a picture, the field edit flag is set whenever an OLE server application is opened
for editing. The field edit flag is not set if you make the change with a Set statement or a fetch from a
database.
Parameters hWndField Window Handle. The handle (or name) of a data field, multiline text
field, table window column, or picture.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalSetFocus
Syntax hWndFocus = SalSetFocus ( hWndToSet )
Warning: You cannot call SalSetFocus in SAM_KillFocus processing because of a Windows limitation.
Parameters hWndToSet Window Handle. The handle (or name) of the window to receive the
focus.
Return Value hWndFocus is the handle of the window that previously had the focus.
SalSetMaxDataLength
Syntax bOk = SalSetMaxDataLength ( hWndField, nLength )
Description Sets a limit on the number of characters that a user can enter into a data field, multiline text field,
or table window column.
Parameters hWndField Window Handle. The handle (or name) of a data field, multiline text
field, or table window column.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalSetProfileString
Syntax bOk = SalSetProfileString ( strSection, strEntry, strValue, strFileName )
Description Set the value of an entry in the specified section of an initialization file or registry. All profile information is
stored as string, so if you want to store an integer it must be converted to a string first. Then it can be
retrieved as an integer using the SalGetProfileInt-Function .
strFileName String. The name of the initialization file or company name depending on the
settings made using the SalUseRegistry function. If you are searching for an
INI file and do not specify the full path, Centura searches for the file in the
Windows subdirectory.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Description Sets the background text of a window. To be associated with a specific window, background text
must immeditately precede the window in the Outliner.
Important: The background text does not require a mnemonic for the function to operate.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalSetWindowLoc
Syntax bOk = SalSetWindowLoc ( hWnd, nX, nY )
Parameters hWnd Window Handle. The handle (or name) of the window to move.
Return Value bOk is TRUE if the function succeeds and FALSE if hWnd is not a valid window
handle.
SalSetWindowSize
Syntax bOk = SalSetWindowSize ( hWnd, nWidth, nHeight )
Parameters hWnd Window Handle. The handle (or name) of the window to resize.
nWidth Number. The new width of the window (expressed in form units).
nHeight Number. The new height of the window (expressed in form units).
Return Value bOk is TRUE if the window is successfully resized, and FALSE if hWnd is an invalid
window handle.
SalSetWindowText
Syntax bOk = SalSetWindowText ( hWnd, strTitle )
A window's text is the title of a form window, modeless dialog box, table window, radio button, check
box, or push button.
For a data field or table window column, the text is the object's value in string form, regardless of the
object's data type.
For a combo box, the text is the contents of the editable data field portion. If the combo box is not
editable, Centura tries to set the list selection to the item that matches the specified string. This latter
statement is true for list boxes as well. The SalSetWindowText function clears the field edit flag.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalShowWindow
Syntax bOk = SalShowWindow ( hWndToShow )
Parameters hWndToShoWindow Handle. The handle (or name) of a window to make visible.
Return Value bOk is TRUE if the previous state of the window was visible and FALSE if it was
hidden. Use this information to hide many windows without first checking that they
SalShowWindowAndLabel
Syntax bOk = SalShowWindowAndLabel ( hWndToShow )
A label is the background text that immediately precedes the window in the outline.
Return Value bOk is TRUE if the previous state of the window was visible and FALSE if it was
hidden. Use this information to hide many windows without first checking that they are visible. When you
restore them to their original state at a later point in time, the return lets you make visible only those
windows that were previously visible.
SalStatusGetText
Syntax nLength = SalStatusGetText ( hWnd, strText, nMaxLen )
Description Gets the text displayed in the status bar of a top-level or MDI window.
Parameters hWnd Window Handle. The handle (or name) of a top-level or MDI window.
Return Value nLength is the length of strText. nLength is zero (0) if the window has no text.
SalStatusSetText
Syntax bOk = SalStatusSetText ( hWnd, strText )
Description Displays specified text in the status bar of a top-level or MDI window.
Parameters hWnd Window Handle. The handle (or name) of a top-level or MDI window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalStatusSetVisible
Syntax bOk = SalStatusSetVisible ( hWnd, bShow )
Parameters hWnd Window Handle. The handle (or name) of a top-level or MDI window.
bShoBoolean. If TRUE, the status bar displays; if FALSE, the status bar hides.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalStrCompress
Syntax bOk = SalStrCompress ( strString )
Description Compresses the specified string. Use this function to compress strings for storage on disk or in the
database. Use this function for long strings, or when storing images and so on.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Description Extracts the first character of a string and returns its decimal value. You must use this function in place of
SalStrLop if the input string contains nonASCII (ANSI) or 16-bit characters. If the character returned is a
16-bit character, the leading byte of the character is in the high-order byte, and the trailing byte of the
character is in the low-order byte.
Use SalNumberHigh to get the leading byte and SalNumberLow to get the trailing byte.
Parameters strString Receive String. The string whose first character is lopped off.
Example On SAM_Click
Set dfString = 'ABC' Call SalStrFirstC
( dfString, dfNumChar )
! Now dfString = 'BC' and dfNumChar = 65
SalStrGetBufferLength
Syntax nLength = SalStrGetBufferLength ( strString )
Centura stores string variables in buffers. The length includes the string's null termination
character.
Parameters strString String. The string whose buffer length you want.
SalStrIsValidCurrency
Syntax bOk = SalStrIsValidCurrency ( strMoney, nPrecision, nScale )
Description Verifies that an entire character string represents a valid currency value. Centura validates the string
based on the current settings for the keywords sDecimal ,
sThousands , sCurrency, iNegCurr, and iCurrency in the [INTL] section of WIN.INI.
nScale Number. The number of digits to the right of the decimal point.
Return Value bOk is TRUE if strMoney is a valid currency value and FALSE otherwise.
SalStrIsValidDateTime
Syntax bOk = SalStrIsValidDateTime ( strDateTime )
Description Verifies that an entire character string represents a valid date/time value. Centura validates the string
based on the current settings for the keywords sShortDate, sLongDate, s1159, s2359, and sTime in
the [INTL] section of WIN.INI.
Return Value bOk is TRUE if strDateTime is a valid date/time value and FALSE otherwise.
Description Verifies that an entire character string represents a valid number value. Centura validates the string
based on the current settings for the keywords sDecimal and sThousands in the [INTL] section of
WIN.INI.
Return Value bOk is TRUE if strNumber is a valid number value and FALSE otherwise.
SalStrLeft
Syntax nLength = SalStrLeft ( strSource, nExtract, strTarget )
Description Returns a substring of a specified length starting at position zero (0), the left-most character in the
string.
You can specify the same string for both strSource and strTarget.
SalStrLeftX
Syntax strTarget = SalStrLeftX ( strSource, nExtract)
Description Returns a substring of a specified length starting at position zero (0), the left-most character in the
string.
You can specify the same string for both strSource and strTarget.
SalStrLength
Syntax nLength = SalStrLength ( strString )
Strings are stored internally in Centura with a null termination character. The null terminator is not
included in the length.
Example On SAM_Create
Set strNumbers = '1234567890' Set
nStringLength = SalStrLength ( strNumbers )
Description Returns the ASCII numeric value of the first character of a string in decimal format. This function
removes the first character of the string.
Parameters strString Receive String. The input string without the first character.
Return Value nCharacter is the ASCII value of the first character of strString. When strString is
null, nCharacter is equal to zero (0).
Example On SAM_Create
Set strString = 'ABC' Set
nCharacter = SalStrLop ( strString )
SalStrLower
Syntax nLength = SalStrLower ( strSource, strTarget )
or
You can specify the same string for both strSource and strTarget.
Examples On SAM_Create
Set nLength = SalStrLower ( 'LOWERCASE', strTarget )
or
On SAM_Create
Set strTarget = SalStrLowerX ( 'LOWERCASE' )
SalStrMid
Syntax nLength = SalStrMid ( strSource, nStartPos, nLength, strTarget )
or
Description Returns a substring, starting at a specified position and containing a specified number of characters.
nStartPos Number. The starting position of the substring (zero is the first position) in
strSource.
You can specify the same string for both strSource and strTarget.
SalStrProper
Syntax nLength = SalStrProper ( strSource, strTarget )
or
Description Converts a string to a proper name. In a proper name, the first letter of each word is uppercase; the
remaining letters are lowercase.
You can specify the same string for both strSource and strTarget.
or
You can specify the same string for both strSource and strTarget.
Examples On SAM_Create
Set nLength = SalStrRepeat ( 'ABC*', 3, strTarget )
or
On SAM_Create
Set strTarget = SalStrRepeatX '( 'ABC*', 3)
or
Description Replaces characters in one string with characters from another string.
Parameters strSource String. The source string that contains characters to replace.
or
or
Description Returns a string of specified length, starting with the last character in the string.
You can specify the same string for both strSource and strTarget.
or
On SAM_Create
Set StrTarget = SalStrRightX ( '123RIGHT', 5 )
SalStrScan
Syntax nOffset = SalStrScan ( strString1, strString2 )
Description Searches for and returns the offset of a specified substring. If there is more than one instance of the string
being searched for, only the offset of the first instance is returned.
Parameters strString1 String. The string to search. The first character in the string is at offset zero
(0).
You can use pattern matching characters. The percent character (%) matches
any set of characters. The underscore character (_) matches any single
character.
Even if strString2 is not a string literal, you need a single backslash to search
for a percent character or an underscore.
Return Value nOffset is a number that indicates the offset (0 origin) of strString2 in strString1. If
Centura does not find strString2 in strString1, SalStrScan returns a -1.
SalStrSetBufferLength
Syntax bOk = SalStrSetBufferLength ( strString, nLength )
Description Sets the buffer string length to the length plus 1 for the terminator and allocates memory. This is only
needed if you want to pass a Receive String to an external function.
Parameters strString Receive String. The string whose buffer length you want to set.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalStrGetBufferLength
SalStrToDate
Syntax dtDateTime = SalStrToDate ( strString )
Description Converts a string to a date/time value.This function uses the system date format to convert a date string.
If you want to be format independent, use SalDateConstruct.
Description Parses a string into substrings (tokens) based on specified start and end delimiters. Centura uses delimiters
to recognize the beginning and end of each substring. Centura interprets the first non-start delimiter
character as the beginning of a substring, and skips any start delimiters that precede this character. For
example, if '!' is a start delimiter, the strings 'Hello' and '!!!Hello' produce the same token: 'Hello'. If the first
non-start delimiter character is an end delimiter character, Centura interprets it as a null substring. This is
useful for comma-separated data where ',' is an end delimiter. Centura recognizes that the records
'data1,data2,,data4' and ',data2,data3,data4' have four tokens each, one of which is null. Once Centura finds
the beginning of a substring, it interprets all characters that follow as elements of the substring until it finds
an end delimiter. For example, if '!' is a start delimiter and '?' is an end delimiter, the string 'abc!def?ghi!'
produces the tokens: 'abc!def' and 'ghi!'. Although the exclamation point is a start delimiter, Centura correctly
interprets them as elements of the substring.
strStartDel String. A string that contains the start delimiter characters. Pass an empty
strEndDel String. A string that contains the end delimiter characters. Pass an empty
strTokenArray String Array. The handle (or name) of an array of substrings created from
strSource.
Return Value nNumTokens is the number of substrings created. nNumTokens is zero (0) if no
substrings are created, or if an error occurs.
SalStrToNumber
Syntax nNumber = SalStrToNumber ( strString )
SalStrTrim
Syntax nNewLength = SalStrTrim ( strSource, strTarget )
or
Description Strips leading and trailing blanks and compresses multiple spaces and tabs within a string to single
spaces.
You can specify the same string for both strSource and strTarget.
SalStrTrimX
Syntax strTarget = SalStrTrimX ( strSource)
Description Strips leading and trailing blanks and compresses multiple spaces and tabs within a string to single
spaces.
You can specify the same string for both strSource and strTarget.
Example On SAM_Create
Set nLength = SalStrTrim ( ' 1 2 3 ', strTarget )
Description Decompresses the specified string. Use this function to decompress a string that you compressed with
SalStrCompress.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalStrUpper
Syntax nLength = SalStrUpper ( strSource, str Target )
You can specify the same string for both strSource and strTarget.
SalStrUpperX
Syntax strTarget = SalStrUpperX ( strSource )
You can specify the same string for both strSource and strTarget.
Example On SAM_Create
Set strTarget = SalStrUpperX ( ' uppercase' )
SalTBarSetVisible
Syntax bOk = SalTBarSetVisible ( hWind, bShw)
Parameters hWnd Window Handle. The handle (or name) of a top-level or MDI window.
bShow Boolean. If TRUE, displays the tool bar; if FALSE, hides the tool bar.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblAnyRows
Syntax bAny = SalTblAnyRows ( hWndTbl, nFlagsOn, nFlagsOff )
Description Determines whether any rows in the specified table window match certain flags. If you set nFlagsOn to
zero (0) and nFlagsOff to zero (0), SalTblAnyRows returns TRUE if the table window contains any rows
at all, regardless of their flags.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nFlagsOn Number. The flags that the row should have. You can combine ROW_* flags
using the OR (|) operator.
nFlagsOff Number. The flags that the row should not have. You can combine
ROW_* flags using the OR (|) operator.
Return Value bAny is TRUE if any of the table window's rows have any of the nFlagsOn flags and
none of the nFlagsOff flags.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblColumnAverage
Syntax nAverage = SalTblColumnAverage ( hWndTbl, nColumnID, nFlagsOn, nFlagsOff )
Description Computes the average of all column values or only specified column values in a table window.
Use Centura row flag constants to specify the rows to use in the computation. For example, you can
choose to average only the values of modified rows.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nFlagsOn Number. The flags that the row should have. You can combine ROW_* flags
using the OR (|) operator.
nFlagsOff Number. The flags that the row should not have. You can combine
ROW_* flags using the OR (|) operator:
Return Value nAverage is the average of all column values or only specified column values in a
table window. nAverage is equal to zero (0) if an error occurs.
SalTblColumnSum
Syntax nSum = SalTblColumnSum ( hWndTbl, nColumnID, nFlagsOn, nFlagsOff )
Description Computes the sum of all column values or only specified column values in a table window.
Use Centura row flag constants to specify the rows to use to compute the sum. For example, you can
choose to sum only the values of modified rows.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nFlagsOn Number. The flags that the row should have. You can combine ROW_* flags
using the OR (|) operator.
nFlagsOff Number. The flags that the row should not have. You can combine
ROW_* flags using the OR (|) operator.
Return Value nSum is the sum of all column values or only specified column values in a table
window. nSum is equal to zero (0) if an error occurs.
SalTblCopyRows
Syntax bOk = SalTblCopyRows ( hWndTbl, nFlagsOn, nFlagsOff )
Description Copies the contents of the specified table window rows to the Clipboard in text format. In the
Clipboard, columns are delimited by TAB characters and rows are delimited by end-of-line
characters.
Set nFlagsOn to zero (0) and nFlagsOff to zero (0) to copy the entire table. The copy stops, without
indicating a failure, after copying 64 Kbytes of text.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nFlagsOn Number. The flags that the row should have. You can combine ROW_* flags
using the OR (|) operator.
nFlagsOff Number. The flags that the row should not have. You can combine
ROW_* flags using the OR (|) operator.
Return Value bOk is TRUE if any of the table window's rows are copied to the Clipboard and
FALSE if no rows matched the indicated flags, or if none of the matched rows could be copied to the
Clipboard.
SalTblCreateColumn
Syntax nColId = SalTblCreateColumn ( hWndTbl, nColumnPos, nDispWidth, nMaxChars, strTitle )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nMaxChars Number. The maximum number of characters that the column can contain.
Return Value nColId is the Column Identifier of the new column. nColld is zero (0) if an error
occurs.
SalTblDefineCheckBoxColumn
Syntax bOk = SalTblDefineCheckBoxColumn( hWnd, hWndCol, nFlags, sCheckedValue, sUncheckedValue )
Parameters hWnd Window Handle. The handle (or name) of a table window.
HWndCol Window Handle. The handle (or name) of a table window column.
nFlags Number. nFlags is a combination of the following flags using the '|' operator:
COL_CheckBox_IgnoreCase = 0x0001
sCheckedValue String. sCheckedValue is the value that a cell will get when the check box is
checked.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblDefineDropDownListColumn
Syntax bOk = SalTblDefineDropDownListColumn( hWnd, hWndCol, nFlags, nLines )
Parameters hWnd Window Handle. The handle (or name) of a table window.
HWndCol Window Handle. The handle (or name) of a table window column.
nFlags Number. nFlags is a combination of the following flags using the '|' operator:
COL_DropDownList_Sorted=0x0001
COL_DropDownList_VScroll=0x0002
COL_DropDownList_Auto=0x0004
COL_DropDownList_Editabel=0x0008
nLines Number. nLines indicates the maximum number of lines to display in the
list.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblDefinePopupEditColumn
Syntax bOk = SalTblDefinePopupEditColumn( hWnd, hWndCol, nFlags, nLines )
Description Define a column as a popup edit window. nLines indicates the maximum number of lines to display in the
control.
Parameters hWnd Window Handle. The handle (or name) of a table window.
HWndCol Window Handle. The handle (or name) of a table window column.
nLines Number. nLines indicates the maximum number of lines to display in the
list.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Description Defines the appearance and behavior of a table window's row header. The row header is a non-editable area
on the left edge of a table window that displays information that stays displayed even when a user scrolls
horizontally. A typical use of a row header is the display of row numbers.
Parameters hWndTable Window Handle. The handle (or name) of a table window.
nFlags Number. The row header attributes. You can combine these flags using the
OR (|) operator. Possible values include:
TBL_RowHdr_MarkEdits
TBL_RowHdr_ShareColor
TBL_RowHdr_Sizable
TBL_RowHdr_Visible
hWndCol Window Handle. The column that the row header mirrors. Whatever
displays in hWndCol displays in the row header. If hWndCol equals
hWndNULL, the row header is blank.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblDefineSplitWindow
Syntax bOk = SalTblDefineSplitWindow ( hWndTable, nRowsLowerHalf, bDragAdjust )
You can insert rows into the lower half of a split table window. This is convenient when the scroll range is
dynamic because you can insert rows without knowing the number of rows in the table window. You can
also use the lower half of a split table window to display summary data.
Parameters hWndTable Window Handle. The handle (or name) of a table window to split.
nRowsLowerHalf Number. The number of rows to make visible in the lower half of the split
window. If you specify zero (0), the table window is not split.
bDragAdjust Boolean. Specify whether (TRUE) or not (FALSE) to let the user
drag-adjust the visible rows in both halves of a split window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblDeleteRow
Syntax bOk = SalTblDeleteRow ( hWndTbl, nRow, nFlag )
Description Deletes a row from a table window but not from the database.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Number. A constant used to coordinate a delete from the table window with a
delete from a SQLBase result set. This parameter can be one of these values:
TBL_Adjust
TBL_NoAdjust
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblDeleteSelected
Syntax bOk = SalTblDeleteSelected ( hWndTbl, hSql )
Description Applies a SQL DELETE statement to all table window rows with the ROW_Selected flag set. You must
prepare or retrieve the SQL DELETE statement before calling this function.
As each row is deleted from the database, Centura deletes it from the table window display.
This function does not perform a COMMIT. You must perform a COMMIT to ensure that the deletions
are not lost in the case of a rollback.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
SalTblDestroyColumns
Syntax bOk = SalTblDestroyColumns ( hWndTbl )
This function only works on table windows that contain only automatic columns.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if hWndTbl is invalid or the table
window contains non-automatic columns (columns created at design time).
SalTblDoDeletes
Syntax bOk = SalTblDoDeletes ( hWndTbl, hSql, nFlagsOn )
Description Applies a SQL DELETE statement to all table window rows that have nFlagsOn flags set. You must
prepare the SQL DELETE statement before calling this function. As each row is deleted from the database,
Centura deletes it from the table window display.
This function does not perform a COMMIT. You must perform a COMMIT to ensure that the deletions are
not lost in the case of a rollback.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nFlagsOn Number. Centura uses row flags to determine which rows to delete. You can
specify either of these flags:
ROW_MarkDeleted
ROW_Selected
Return Value bOk is TRUE if any rows are deleted and FALSE otherwise. bOk is FALSE if
hWndTbl or hSql is invalid.
SalTblDoInserts
Syntax bOk = SalTblDoInserts ( hWndTbl, hSql, bClearFlags )
Description Applies a SQL INSERT statement to all the rows in a table window that have the ROW_New flag set. You
must prepare the SQL INSERT statement before calling this function.
This function does not perform a COMMIT. You must perform a COMMIT to ensure that insertions are
not lost in the case of a rollback.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
bClearFlags Boolean. Whether to reset the ROW_New flag. If TRUE, Centura clears the
ROW_New flag of each inserted row; if FALSE, Centura does not clear the
ROW_New flag of each inserted row. This is useful for error handling; if an
error occurs, you can rollback the transaction and try again.
Return Value bOk is TRUE if the function succeeds and FALSE if hWndTbl or hSql is invalid.
Description Applies a SQL UPDATE statement to all table window rows with the ROW_Edited flag set. You must
prepare the SQL UPDATE statement before calling this function. This function does not perform a
COMMIT. You must perform a COMMIT to ensure that the updates are not lost in the case of a rollback.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
bClearFlags Boolean. Whether to reset the ROW_Edited flag. If TRUE, Centura clears the
ROW_Edited flag of each changed row; if FALSE, Centura does not clear the
ROW_Edited flag of each changed row. This is useful for error handling; if an
error occurs, you can roll back the transaction and try again.
Return Value bOk is TRUE if the function succeeds and FALSE if hWndTbl or hSql is invalid.
SalTblFetchRow
Syntax nResult = SalTblFetchRow ( hWndTbl, nRow )
Description Sends a SAM_FetchRow message to a table window if the row you specify is not currently in the table
window cache. To process the SAM_FetchRow message, fetch the row from the database or another data
source.
The SAM_FetchRow message sets the context row to the row you specify before the table window
receives the message.
Parameters hWndTbl Window Handle. The handle (or name) of the table window that owns the
row being retrieved.
SalTblFindNextRow
Syntax bOk = SalTblFindNextRow ( hWndTbl, nRow, nFlagsOn, nFlagsOff )
Description Scans forward in a table looking for a row whose flags match those specified. The search stops at the
first row that has any of the nFlagsOn flags set, and none of the nFlagsOff flags set
.
Use this function in a loop to find all the table window rows that match specified conditions. You do not
need to increment the row number; Centura continues the search starting at the next row. To begin the
search at the first row, set nRow to TBL_MinRow.
Note: You cannot use TBL_MinRow without first assigning its value to a variable. This is because TBL_MinRow is a
Centura constant, and nRow is a receive parameter whose value the function can change.
Parameters hWndTbl Window Handle. The handle of the table window to search.
nRow Receive Number. The row at which to begin the search; the search starts on
nRow + 1. If Centura finds a row, it returns its row number in this parameter.
nFlagsOff Number. The flags the row should not have. Specify zero (0)
for no flags.
You can specify any of the ROW_* flags for nFlagsOn and nFlagsOff. If
you want to specify more than one, combine them using the OR (|)
operator.
Return Value bOk is TRUE if Centura finds a row and FALSE if there are no matches.
SalTblFindPrevRow
Syntax bOk = SalTblFindPrevRow ( hWndTbl, nRow, nFlagsOn, nFlagsOff )
Description Scans backward in a table looking for a row whose flags match those specified. The search stops at the
first row that has any of the nFlagsOn flags set, and none of the nFlagsOff flags set.
Use this function in a loop to find all the table window rows that match specified conditions. You do not
need to decrement the row number; Centura continues the search starting at the next row. To begin the
search at the last row, set nRow to TBL_MaxRow.
Note: You cannot use TBL_MaxRow without first assigning its value to a variable. This is because TBL_MaxRow is a
Centura constant, and nRow is a receive parameter whose value the function can change.
Parameters hWndTbl Window Handle. The handle of the table window to search.
nRoReceive Number The row at which to begin the search; the search starts on
nRow - 1. If Centura finds a row, it returns its row number in this parameter.
nFlagsOff Number. The flags the row should not have. Specify zero (0)
for no flags.
You can specify any of the ROW_* flags for nFlagsOn and nFlagsOff. If you
want to specify more than one, combine them using the OR (|) operator.
Return Value bOk is TRUE if Centura finds a row and FALSE if there are no matches.
SalTblGetColumnText
Syntax bOk = SalTblGetColumnText ( hWndTbl, nColumnID, strText )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblGetColumnTitle
Syntax nLength = SalTblGetColumnTitle ( hWndCol, strText, nMaxLen )
Parameters hWndCol Window Handle. The handle (or name) of a table window column.
Return Value nLength is the length of the column title returned in strText.
SalTblGetColumnWindow
Syntax hWndCol = SalTblGetColumnWindow ( hWndTbl, nCol, nFlags )
Parameters hWndTbl Window Handle. The handle (or name) of the table window that contains
the column whose window handle you want.
COL_GetID
SalTblInsertRow
Syntax nNewRow = SalTblInsertRow ( hWndTbl, nRow )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
If this value is a valid row number within the table window range, then
Centura inserts a blank row at that location. If you specify TBL_MaxRow,
Centura appends the row to the end of the table window.
Return Value nNewRow is the number of the new row if the function succeeds. It is equal to
TBL_Error if an error occurs.
SalTblKillEdit
Syntax bOk = SalTblKillEdit ( hWndTbl )
Description Takes a row out of edit mode and selects the row. This causes the row to receive both SAM_Validate and
SAM_KillFocus messages.
Parameters hWndTbl Window Handle. The handle (or name) of the table window that contains
the row just inserted or modified.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblKillFocus
Syntax bOk = SalTblKillFocus ( hWndTbl )
Description Turns off the table window's focus frame. This is useful when the user chooses a menu item from a table
window menu; in this case, the focus cannot leave the table window.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblPasteRows
Syntax bOk = SalTblPasteRows ( hWndTbl )
Description Pastes the contents of the Clipboard to the specified table window. Centura assumes the Clipboard data is
in text format with cells delimited by tab characters and rows delimited by end-of-line characters. Centura
inserts the new rows into the table window without overwriting existing rows, and converts the data to the
data types of the corresponding table window columns.
Parameters hWndTbl Window Handle. The handle (or name) of the table window receiving the
data from the Clipboard.
Return Value bOk is TRUE if the Clipboard contains text that is successfully inserted into the table
window, and FALSE otherwise, and if none of the columns are editable.
SalTblPopulate
Syntax bOk = SalTblPopulate( hWndTbl, hSql, strSelect, nMethod )
Description Compiles, binds, and executes a SQL SELECT statement, then fetches the rows of the result set and
populates a table window with them. SalTblPopulate also manages table window browsing.
This function also works with table windows that do not have columns. Centura creates columns at runtime
based on the SQL statement's SELECT list, and uses the database column names as table window column
titles. If you call SalTblPopulate again during the same runtime session, Centura destroys the automatic
table window columns created by the last SELECT statement and creates new columns.
If you process and Return from the SAM_FetchRow message, SalTblPopulate does not fetch that row into
the table window. If you process but do not Return from the
SAM_FetchRow message, SalTblPopulate fetches the row into the table window. The SAM_FetchRow
message is sent before the row is actually fetched from the result set so in processing this message, you
cannot refer to the row being fetched. However, the SAM_FetchRowDone message is sent after the row is
fetched, enabling you to refer to the row just fetched.
Parameters hWndTbl Window Handle. The handle (or name) of the table window to populate.
hSql Sql Handle. The handle of the SELECT statement. Do not use the Sql Handle
passed to SalTblPopulate by other functions while the table window is in use.
strSelect String. The SELECT statement. If the string is null (“), Centura uses the
previously prepared SELECT statement associated with hSql. This avoids
re-preparing the statement each time SalTblPopulate executes.
nMethod Number. How to populate the table window. Specify one of these values:
TBL_FillAll TBL_FillAllBackground TBL_FillNormal
Return Value bOk is TRUE if the function succeeds and FALSE if either hWndTbl or hSql is
invalid.
SalTblQueryCheckBoxColumn
Syntax bOk = SalTblQueryCheckBoxColumn( hWnd, hWndCol, nFlags, sCheckedValue, sUncheckedValue )
Description If the column is defined as a check box, this function retrieves information about the check box and
returns TRUE. If it is not a check box, this function returns FALSE.
Parameters hWnd Window Handle. The handle (or name) of a table window.
HWndCol Window Handle. The handle (or name) of a table window column.
nFlags Receive Number. nFlags is a combination of the following flags using the
'|' operator: COL_CheckBox_IgnoreCase = 0x0001
sCheckedValue Receive String. sCheckedValue is the value that a cell will get when the check
box is checked.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblQueryColumnCellType
Syntax bOk = SalTblQueryColumnCellType( hWnd, hWndCol, nType )
Description Indicates whether a column is a checkbox, drop down list, popup edit, or standard column.
Parameters hWnd Window Handle. The handle (or name) of a table window.
hWindCol Window Handle. The handle (or name) of a table window column.
COL_CellType_Standard=1 COL_CellType_CheckBox=2
COL_CellType_DropDownList=3 COL_CellType_PopupEdit=4
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Parameters hWndCol Window Handle. The handle (or name) of a table window column.
nFlags Number. The column flags to test. You can combine COL_* flags using the
OR (|) operator.
Return Value bSet is TRUE if any of the flags indicated by nFlags are set and FALSE otherwise.
SalTblQueryColumnID
Syntax nColID = SalTblQueryColumnID ( hWndCol )
Return Value nColID is the Column Identifier. nColID is -1 if hWndCol is not a valid column.
SalTblQueryColumnPos
Syntax nPos = SalTblQueryColumnPos ( hWndCol )
Return Value nPos is the Column Position. nPos is -1 if hWndCol is not a valid handle for a table
window column.
SalTblQueryColumnWidth
Syntax bOk = SalTblQueryColumnWidth ( hWndTbl, nFormUnits )
Description Returns the width (in form units) of a table window column.
Parameters hWndTbl Window Handle. The handle (or name) of a table window column.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblQueryContext
Syntax nContext = SalTblQueryContext ( hWndTbl )
Before sending a SAM_FetchRow message, Centura automatically sets the context row so that
assignments made while processing the message reference the correct row.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
SalTblQueryDropDownListColumn
Syntax bOk = SalTblQueryDropDownListColumn( hWnd, hWndCol, nFlags, nLines )
Description If the column is defined as a drop down list, this function retrieves information about the list and returns
TRUE. If it is not a drop down list, this function returns FALSE.
Parameters hWnd Window Handle. The handle (or name) of a table window.
HWndCol Window Handle. The handle (or name) of a table window column.
nLines Receive Number. nLines indicates the maximum number of lines to display
in the list.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblQueryFocus
Syntax bOk = SalTblQueryFocus ( hWndTbl, nRow, hWndCol )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Receive Window Handle. The handle of the column with the focus.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_Click
Call SalTblQueryFocus ( hWndtblTelephone,
nRow,hWndColumn )
SalTblQueryLinesPerRow
Syntax bOk = SalTblQueryLinesPerRow( hWndTbl, nLines )
Parameters HWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblQueryLockedColumns
Syntax nLockedColumns = SalTblQueryLockedColumns ( hWndTbl )
Locked table window columns do not scroll horizontally; they are fixed to the left side of the table
window. All other columns appear to scroll under the locked columns.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value nLockedColumns is the number of locked columns. If there are no locked columns,
nLockedColumns is zero (0).
SalTblQueryPopupEditColumn
Syntax bOk = SalTblQueryPopupEditColumn( hWnd, hWndCol, nFlags, Lines )
Description If the column is defined as a popup edit, this function retrieves information about the popup edit and
returns TRUE. If it is not a popup edit, this function returns FALSE.
Parameters hWnd Window Handle. The handle (or name) of a table window.
HWndCol Window Handle. The handle (or name) of a table window column.
nFlags Receive Number. nFlags is a combination of the following flags using the
'|' operator: COL_DropDownList_Sorted =0x0001
COL_DropDownList_VScroll =0x0002 COL_DropDownList_Auto=0x0004
COL_DropDownList_Editable=0x0008
nLines Receive Number. nLines indicates the maximum number of lines to display
in the list.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nRoNumber. The row number of the row whose flags you want to test. nFlags
Number. The row flags to test for. You can combine ROW_* flags using the
OR (|) operator.
Return Value bOk is TRUE if any of the specified flags are set and FALSE if none of the specified
flags are set.
Example On SAM_SetFocus
If SalTblQueryRowFlags ( hWndForm, lParam, ROW_New )
SalTblQueryRowHeader
Syntax bOk = SalTblQueryRowHeader ( hWndTbl, strTitle, nMaxTitle, nWidth,
nFlags, hWndCol )
Description Gets a table window's row header definition. The row header is a non-editable area on the left edge of a
table window that displays information that you do not want to scroll off the screen as the user scrolls
horizontally. A typical use is the display of row numbers.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
TBL_RowHdr_MarkEdits
TBL_RowHdr_ShareColor
TBL_RowHdr_Sizable
TBL_RowHdr_Visible
hWndCol Receive Window Handle. The column that the row header mirrors. Whatever
displays in hWndCol displays in the row header. If hWndCol is equal to
hWndNULL, the row header is blank.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblQueryScroll
Syntax bOk = SalTblQueryScroll ( hWndTbl, nPosition, nMinRange, nMaxRange )
The scroll position is the row number of the row that is currently at the top of the window. You set the table
window range with SalTblSetRange and Centura changes it when you insert or delete rows from the table
window.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblQuerySplitWindow
Syntax bOk = SalTblQuerySplitWindow ( hWndTbl, nRowsLowerHalf,Syntax
bDragAdjust )
Parameters hWndTbl Window Handle. The handle (or name) of a split table window.
nRowLowerHalf Receive Number. The number of visible rows in the lower half of the split
window. If zero (0), the table is not split.
bDragAdjust Receive Number Boolean. Specify whether (TRUE) or not (FALSE) the
user can drag-adjust the visible rows in both halves of a split window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblQueryTableFlags
Syntax bSet = SalTblQueryTableFlags ( hWndTbl, nFlags )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nFlags Number. The table flags to test. You can combine TBL_* flags
using the OR (|) operator.
Return Value bSet is TRUE if any of the flags indicated by nFlags are set and FALSE otherwise.
SalTblQueryVisibleRange
Syntax bOk = SalTblQueryVisibleRange ( hWndTbl, nRangeMin, nRangeMax )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblReset
Syntax bOk = SalTblReset ( hWndTbl )
Description Clears a table window by discarding all rows from the table window cache and setting the table range to 0,
-1.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblScroll
Syntax bOk = SalTblScroll ( hWndTbl, nRow, hWndColumn, nTBLScroll )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nRoWNumber The number of the row to scroll to. If you specify -1, only the column scrolls
into view.
hWndColumn Window Handle. The table window column to scroll into view. If you specify
hWndNULL, only the row scrolls into view.
nTBLScroll Number. The position of the scroll row. Specify one of these:
TBL_AutoScroll
TBL_ScrollBottom
TBL_ScrollTop
Return Value bOk is TRUE if the function succeeds and FALSE if Centura cannot scroll the row.
This function fails if either nRow or nTBLScroll are invalid values.
SalTblSetCellTextColor
Syntax bOk = SalTblSetCellTextColor ( hWndCol, nColor, bDiscardable )
Parameters hWndCol Window Handle. The handle (or name) of a table window column.
nColor Number. The cell text color. Specify one of the predefined windows
colors.
bDiscardable Boolean. Determines whether Centura discards the cell text color if and
when the user re-fetches the row. If TRUE, Centura discards the cell text color
when the user refetches the row. If FALSE, Centura keeps the cell text color.
This requires additional resources to keep the row in memory.
SalTblSetColumnFlags
Syntax bOk = SalTblSetColumnFlags ( hWndCol, nFlags, bSet )
Parameters hWndCol Window Handle. The handle (or name) of a table window column.
nFlags Number. The column flags to change. You can combine COL_* flags
using the OR (|) operator.
bSet Boolean. If TRUE, Centura sets the flags; if FALSE, Centura clears the
flags.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails. To define a column a
column as multiline use the flag:
COL_MultilineCell = 0x00800000
SalTblSetColumnPos
Syntax bOk = SalTblSetColumnPos ( hWndCol, nPos )
Parameters hWndCol Window Handle. The handle (or name) of a table window column to
move.
nPos Number. The new position of the table window column. 1 is the first (left-most)
position, 2 is the second position, and so on.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetColumnText
Syntax bOk = SalTblSetColumnText ( hWndTbl, nColumnID, strText )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetColumnTitle
Syntax bOk = SalTblSetColumnTitle ( hWndCol, strTitle )
Parameters hWndCol Window Handle. The handle (or name) of a table window column.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetColumnWidth
Syntax bOk = SalTblSetColumnWidth ( hWndTbl, nFormUnits )
Parameters hWndTbl Window Handle. The handle (or name) of a table window column.
nFormUnits Number. The table window column's display width in form units.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetContext
Syntax bOk = SalTblSetContext ( hWndTbl, nRow )
Setting the context row does not send a SAM_FetchRow message. If the row is not currently in memory,
Centura creates a new row in memory and sets its cell values to null.
Parameters hWndTbl Window Handle. The handle (or name) of a table window whose context
row you want to set.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetFlagsAnyRows
Syntax bAny = SalTblSetFlagsAnyRows ( hWndTbl, nFlags, bSet,
nFlagsOn, nFlagsOff )
Parameters hWndTbl Window Handle. The handle (or name) of a table window whose row
flags you want to set or clear.
nFlags Number. The flags to change. You can combine flag values using the OR
(|) operator.
nFlagsOn Number. The flags that the rows should have. You can combine flag values
using the OR (|) operator.
Set nFlagsOn to zero (0) and nFlagsOff to zero (0) to specify all rows.
nFlagsOff Number. The flags that the rows should not have. You can combine flag
values using the OR (|) operator.
Set nFlagsOn to zero (0) and nFlagsOff to zero (0) to specify all rows.
Return Value bAny is TRUE if any of the table window's rows have any of the nFlagsOn flags and
none of the nFlagsOff flags.
SalTblSetFocusCell
Syntax bOk = SalTblSetFocusCell ( hWndTbl, nRow, hWndCol, nEditMin, nEditMax )
Description Sets the focus to the specified table window cell (row and column). Centura puts the table window into edit
mode and lets the user select a portion of the data in the cell.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
hWndCol Window Handle. The handle (or name) of the column that receives the
edit focus.
nEditMin Number. The position of the left-most character. When used with nEditMax,
this parameter lets the user select a portion of the cell text.
nEditMax Number. The position of the right-most character. When used with nEditMin,
this parameter lets the user select a portion of the cell text.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nRoNumber. The row number of the row to which to apply the focus frame.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetLinesPerRow
Syntax bOk = SalTblSetLinesPerRow( hWndTbl, nLines )
Description Sets the height of a row in lines. Multirow lines are useful when a column is defined as multiline. The text
in each cell will wrap. To define a column a column as multiline use the function SalTblSetColumnFlags
with the flag: COL_MultilineCell = 0x00800000
Parameters HWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetLockedColumns
Syntax bOk = SalTblSetLockedColumns ( hWndTbl, nLockedColumns )
Description Sets the number of locked table window columns. Table window columns that you lock do not scroll
horizontally; they are fixed to the left side of the table window. All other columns appear to scroll under the
locked columns. This function locks zero (0) or more of the left-most visible columns of a table window.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetRange
Syntax bOk = SalTblSetRange ( hWndTbl, nMin, nMax )
nMax Number. The upper boundary of the table window. Setting nMin
and nMax:
You can specify an empty table with the range 0, -1. You can specify a
dynamic range with the values zero (0), TBL_MaxRow. Centura determines
the higher boundary when the application returns TBL_NoMoreRows from a
SAM_FetchRow me ssa ge, o r fro m the return of the SAM_FetchDone
message.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetRow
Syntax nRowNum = SalTblSetRow ( hWnd, nRowPos )
Description Sets the focus to the first, last, next, or previous row in a table window.
Parameters tName Window Handle. The handle (or name) of the window whose current focus
row you want to change.
nRowPos Number. The position of the focus row. Specify one of these values:
TBL_SetFirstRow TBL_SetLastRow TBL_SetNextRow TBL_SetPrevRow
Return Value nRowNum is the row number of the new focus row.
SalTblSetRowFlags
Syntax bOk = SalTblSetRowFlags ( hWndTbl, nRow, nFlags, bSet )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nRoNumber. The row number of the row whose flags you want to set or clear.
nFlags Number. The row flags. You can combine any of the ROW_* flags using the
OR (|) operator.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSetTableFlags
Syntax bOk = SalTblSetTableFlags ( hWndTbl, nFlags, bSet )
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
nFlags Number. The table flags. You can combine any of the TBL_* flags using the
OR (|) operator.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalTblSortRows
Syntax bRet = SalTblSortRows ( hWndTbl, nColumnID, nOrder )
Description Sorts the rows of a non-discardable table window based on the values in one of the table window's
columns. You must create this column at design time; it cannot be an automatic column such as a column
created by SalTblPopulate. or SalTblCreateColumn.
Important: The table window cache must not be discardable and the setting of maximum rows in memory
must be large enough to hold the rows that you are sorting.
Parameters hWndTbl Window Handle. The handle (or name) of a table window.
TBL_SortDecreasing
TBL_SortIncreasing
Return Value bRet is TRUE if the function succeeds and FALSE if nColumnID is not a valid
identifier.
SalTimerKill
Syntax bOk = SalTimerKill ( hWnd, nIDEvent )
Description Destroys an object's system timer. Centura removes any pending SAM_Timer messages from the
message queue of hWnd. Set a system timer with the SalTimerSet function.
Return Value bOk is TRUE if Centura successfully kills the event and FALSE if Centura cannot
find the specified timer.
Example On SAM_Destroy
Call SalTimerKill ( dfClock, 1 )
Description Creates a system timer for a given object. When a timer event occurs, Centura sends SAM_Timer
messages to the object in specified intervals.
Timers are a limited global resource. Your application must check the value returned by SalTimerSet to
verify that the timer was created.
Parameters hWnd Window Handle. The handle (or name) of an object associated with a system
timer.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_Create
Set bOk = SalTimerSet ( hWndItem, 1, 1000 )
SalTrackPopupMenu
Syntax bOk = SalTrackPopupMenu ( hWndProcMsgs, strMenuName, nFlags, nX, nY )
Parameters hWndProcMsgs Window Handle. The handle (or name) of the top-level window that processes
messages generated by the pop-up menu.
nFlags Number. Specifies how the pop-up menu displays. You can combine flag
values using the OR (|) operator.
nX Number. The position of the pop-up menu on the X axis. The value of this
parameter is ignored if you set the TPM_CursorX flag in nFlags.
nY Number. The position of the pop-up menu on the Y axis. The value of this
parameter is ignored if you set the TPM_CursorY flag in nFlags.
The nX and nY Parameters together represent a point (the top left, top middle, or top right) of the pop-up
menu, depending on the nFlags value.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_Click
Call SalTrackPopupMenu ( hWndForm, 'menuEdit', TPM_CursorX |
TPM_CursorY | TPM_CenterAlign, 0, 0 )
SalUpdateWindow
Syntax bOk = SalUpdateWindow ( hWndUpdate )
Painting is a low priority in Microsoft Windows. Windows sends WM_Paint messages to the end of an
object's message queue and processes them only after it processes all other messages in the queue. If,
during the development phase of your application, you find that painting is being delayed, you can force
Centura to update a window.
For example, if you call SalListClear to delete all the entries in a list box and follow this call with a loop,
Centura delays repainting the list box until it completes processing the loop. To force Centura to repaint
the list box before processing the
loop, call SalUpdateWindow.
Parameters hWndUpdate Window Handle. The handle (or name) of the window to update.
Return Value bOk is TRUE if the function succeeds and FALSE if hWndUpdate is not a valid
window handle.
Description This function is used to re-direct all SalProfile* functions to use the Registry. All values for the SalProfile*
functions are saved as strings. The INI file name used as the last parameter of the SalProfile* functions will
be used as the application name. The resulting path will be:
\\HKEY_CURRENT_USER\Software\<company name>\<application
name>\<section>\<setting>\
Parameters bUseRegistry - TRUE if registry is to be used, FALSE if INI files are to be used.
Return Value bOk is TRUE if the function succeeds and FALSE if function fails.
SalValidateSet
Syntax bOk = SalValidateSet ( hWndCC, bValState, lParam )
Description You call SalValidateSet when the user tries to move the focus to the custom control. In Centura, changes
in focus trigger validation. SalValidateSet tells Centura that the focus is changing to a custom control so
that Centura can perform validation as needed.
Important: You must set the Tab stop item in the Customizer to Tab or Group so that the custom control
can receive the focus.
Return Value bOk is TRUE Centura sends SAM_Validate when the custom control loses the focus
and FALSE if Centura does not send SAM_Validate when the custom control loses the focus.
Specify TRUE in bValState for controls that behave like editable objects. When bValState is TRUE,
Centura sends SAM_Validate to the object losing the focus:
• If validation succeeds, SalValidateSet returns TRUE and Centura moves the focus to the
custom control. Later, when the user moves the focus off the custom control, Centura sends it
SAM_Validate if its field edit flag is set to TRUE.
• If validation fails, SalValidateSet returns FALSE and Centura sets the focus to the invalid
object.
For an editable custom control, you want Centura to send SAM_Validate if the user changes the value. Call
SalSetFieldEdit( hWndItem, TRUE ) when the user changes the value so that Centura sends SAM_Validate
if the user tries to change the focus to another object.
SalWaitCursor
Syntax bOk = SalWaitCursor ( bOn )
Description Displays or removes the hourglass cursor. The hourglass is a visual indicator that the application is busy.
You must always call this function twice; once to turn the cursor into an hourglass and again to restore
it to its original form.
Parameters bOn Boolean. Whether to turn the hourglass on (TRUE) or off (FALSE).
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalWindowClassName
Syntax sClassName = SalWindowClassName( hWnd )
Parameters hWnd Window Handle. The window handle of an instance of a Window Class
object.
Return Value Returns an empty string if the window is not a class object.
Description Gets the value of a named property for an instance of a QuickObject. The property must have been
created at designtime with the QuickObject Editor.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalWindowHandleToNumber
Syntax nWnd = SalWindowHandleToNumber ( hWnd )
For example, you can pass a window handle as a SalSendMsg wParam parameter as follows:
SalWindowIsDerivedFromClass
Syntax bOk = SalWindowIsDerivedFromClass( hWnd, ClassName )
Description Tells you if a window is an instance of the class that you specify or an instance of a class that is derived
from the class that you specify.
Call this function to determine if you can make a late-bound call to a function defined in the named class
using the window handle that you specify. If you make a latebound function call with a handle that is not for
a window derived from the named class and the function returns a value, you get an error at runtime and
the application ends.
Parameters hWnd Window Handle. The handle (or name) of the window.
ClassName Symbol. The ClassName parameter is a symbol, not a string. Type the class
name without single quotes.
Return Value bOk is TRUE if the window is an instance of the named class or an instance of a class
that is derived from the named class.
SalWinHelp
Syntax bOk = SalWinHelp( hWnd, strFile, nCommand, nData,
strData )
Use SalWinHelp to start a help system you created with the Microsoft Windows SDK. Centura sends a
SAM_Help message to the top-level object when the user presses the F1 key. Process this message
by calling SalWinHelp.
Parameters hWnd Window Handle. The handle (or name) of the window requesting
help.
strData String. The context or keyword string of the requested help topic. This
parameter is null unless nCommand is equal to HELP_Key.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalYieldQueryState
Syntax bEnabled = SalYieldQueryState ( )
Parameters No parameters.
SalYieldStartMessages
Syntax bOk = SalYieldStartMessages ( hWnd )
Enable yielding to give the user enough control to stop long operations. For example, if it takes a long time
to populate a table window, allow the user access to a Cancel push button to stop the query.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SalYieldStopMessages
Syntax bOk = SalYieldStopMessages ( )
Description Stops yielding and the sending of messages to the window specified in a prior call to
SalYieldStartMessages.
Parameters No parameters.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlClearImmediate
Syntax bOk = SqlClearImmediate ( )
You connect the internal handle to a database by calling SqlImmediate and it remains connected until the
application terminates or you explicitly disconnect it with SqlClearImmediate.
SqlClearImmediate causes an implicit COMMIT if it is the last cursor you disconnect from the database.
Parameters No parameters.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlClose
Syntax bOk = SqlClose ( hSql )
Description Invalidates a SQL command and/or frees the cursor name associated with the specified cursor,
making it available for re-use.
If you create a named cursor by calling SqlOpen and then instead of closing it, call SqlOpen or SqlExecute
again, you get an error that the name has already been used.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlCommit
Syntax bOk = SqlCommit ( hSql )
Description Commits all of the SQL transaction's cursors that are connected to the same database. NOTE: To prevent
destroying a cursor's result set when a COMMIT is performed, turn on cursor context preservation by calling
SqlSetParameter and setting the DBP_PRESERVE parameter to TRUE.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlConnect
Syntax bOk = SqlConnect ( hSql )
Centura uses the values in the SqlDatabase, SqlUser, and SqlPassword variables. The default values for
these variables are DEMO, SYSADM, and SYSADM. The value of other system variables such as
SqlNoRecovery, SqlInMessage, and SqlOutMessage take effect after this function executes.
Parameters hSql Receive Sql Handle. A handle that identifies a database connection.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlContextClear
Syntax bOk = SqlContextClear ( hSql )
Description Clears the context set by SqlContextSet. Centura evaluates the bind and INTO variables associated
with the specified Sql Handle in the local context. For new applications, call SqlVarSetup instead of
this function.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlContextSet
Syntax bOk = SqlContextSet ( hSql )
Description Sets the context for future processing (for example, calls to SqlPrepare, SqlFetchNext,
SqlFetchPrevious, and SqlFetchRow). Sql* functions you call after SqlContextSet behave as if they
are in the window identified by hWndForm. Call this function in a class to perform SQL processing for
the current window without fully qualifying bind and INTO variables. This function is also useful for
global functions.
Important: After you call SqlContextSet, the context for bind variables and INTO variables is always hWndForm.
If you call a Sql* function in an internal function, window function, or class function after calling
SqlContextSet, Centura does not recognize local variables or
Parameters that you use as bind variables and INTO
variables.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Description This function is like SqlContextSet, except for an additional parameter: SqlContextSet sets the context of
the Sql Handle to the window identified by hWndForm; SqlContextSetToForm sets the context of the Sql
Handle to the window you specify in the second parameter.
Call this function from a child table window when you want to set the context to the parent form window;
in this situation hWndForm refers to the child table window, not to the parent form window.
SqlDirectoryByName
Syntax bOk = SqlDirectoryByName ( strServerName,
strArrayNames )
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_AppStartup
Call SqlDirectoryByName ( 'server1', strDatabaseNames )
SqlDisconnect
Syntax bOk = SqlDisconnect ( hSql )
Disconnecting the last Sql Handle from a database causes an implicit COMMIT of the database.
Disconnect all Sql Handles before the application exits.
Parameters hSql Sql Handle. The handle that identifies the database connection to disconnect.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_AppExit
Call SqlDisconnect ( hSqlPrimary )
SqlDropStoredCmd
Syntax bOk = SqlDropStoredCmd ( hSql, strName )
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlError
Syntax nError = SqlError ( hSql )
Description Returns the most recent error code for the specified Sql Handle. SqlError is not useful after a call to
SqlImmediate because SqlImmediate does not return a handle that you can use as the parameter for
SqlError.
Return Value nError is the error code returned. It is equal to zero (0) if no error occurred.
SqlErrorText
Syntax bOk = SqlErrorText ( nError, nType, strError, nLength, nRealLength )
Description Gets the error reason or remedy for the specified error code from ERROR.SQL. Call SqlError to get the
most recent error code. When your application detects an error condition, you can use the error code
returned by SqlError to look up the error reason and remedy with SqlErrorText.
nType Number. Specify one or both (by combining them with the OR (|) operator) of
these constants:
Constant Description
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlExecute
Syntax bOk = SqlExecute ( hSql )
Description Executes a SQL statement that was prepared with SqlPrepare or retrieved with SqlRetrieve.
SqlExecute does not fetch data. To fetch data, call one of the SqlFetch* functions: SqlFetchNext,
SqlFetchPrevious, or SqlFetchRow. Bind variables are sent to the database when you call SqlExecute.
You can use SqlExecute just like SqlOpen, but you can never address rows in the result set by a cursor
name. That is, you cannot use the 'CURRENT OF <cursor_name>' and 'ADJUSTING <cursor_name>'
clauses to UPDATE, DELETE or INSERT result set rows.
Parameters hSql Sql Handle. The handle associated with a SQL statement.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlExecutionPlan
Syntax bOk = SqlExecutionPlan ( hSql, strString, nLength )
Description Gets the execution plan for a compiled SQL statement. An execution plan shows the tables, views, indexes,
and optimizations for the SQL statement. Tables and views are listed in the order in which they are
processed.
Parameters hSql Sql Handle. The handle associated with a compiled SQL statement.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlExists
Syntax bOk = SqlExists ( strSelect, bExists )
SqlExists uses the values of the SqlDatabase, SqlUser, and SqlPassword variables to connect to a
database, and uses an internal Sql Handle to execute the specified query.
Parameters strSelect String. The S ELECT statement that establishes the existence
of a row.
bExists Receive Boolean. TRUE if the row exists and FALSE if it does not.
Return Value bOk is TRUE if strSelect is correct and executable and FALSE otherwise.
SqlExtractArgs
Syntax bOk = SqlExtractArgs ( wParam, lParam, hSql, nError,
nPos )
Description Extracts information from the SAM_SqlError wParam and lParam arguments. Call this function only while
processing a SAM_SqlError message which is sent when an error occurs while executing a SQL function.
hSql Receive Sql Handle. The handle of the function that got an error. Centura
extracts this value from the wParam argument.
nError Receive Number. The error code. Centura extracts this value from the
low-order word of the lParam argument.
nPos Receive number. The error position, if relevant to the function call. Centura
extracts this value from the high-order word of the lParam argument.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlFetchNext
Syntax bOk = SqlFetchNext ( hSql, nInd )
Description Fetches the next row in a result set. You must have prepared the SELECT statement with SqlPrepare and
executed it with SqlExecute, or opened it with SqlOpen.
nInd Receive Number. The fetch return code is one of the FETCH_* values.
Return Value bOk is TRUE if another row was fetched and FALSE if no row was fetched.
SqlFetchNext does not return FALSE and Fetch indicatior does not show EOF until you attempt to fetch
past the last row.
SqlFetchPrevious
Syntax bOk = SqlFetchPrevious ( hSql, nInd )
Description Fetches the previous row in a result set. You must have prepared the SELECT statement with
SqlPrepare and executed it with SqlExecute, or opened it with SqlOpen.
nInd Receive Number. The fetch return code is one of the FETCH_* values.
Return Value bOk is TRUE if there is another row to fetch and FALSE otherwise.
SqlFetchRow
SqlFetchRow
Syntax bOk = SqlFetchRow ( hSql, nRow, nInd )
Description Fetches a row according to an absolute row position. You must have prepared the SELECT statement
with SqlPrepare and executed it with SqlExecute, or opened it with SqlOpen.
Receive Number. The fetch return code is one of the FETCH_* values.
Return Value bOk is TRUE if nRow could be fetched and FALSE otherwise.
SqlGetError
Syntax bOk = SqlGetError ( hSql, nError, strErrorString )
Description Turns off backend error mapping and reports real backend errors.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
You specify the Sql Handle in hSql and SqlGetError returns the last error number and error text in nError
and strErrorString.
If the backend is SQLBase, this function does the same thing as calling SqlError and SqlGetErrorText.
SqlGetErrorPosition
Syntax bOk = SqlGetErrorPosition ( hSql, nPos )
Description Returns the offset of the error position within a SQL statement. After a SqlPrepare, the error position
points to the place in the SQL statement where Centura detected aSyntax error. The first character
position in the SQL statement is zero (0).
nPos Receive Number. The position in the SQL statement where aSyntax error
occurred.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlGetErrorText
Syntax bOk = SqlGetErrorText ( nError, strText )
or
Description Gets the message text for a SQL error number from ERROR.SQL.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
or
SqlGetErrorTextX
Syntax strText = SqlGetErrorTextX ( nError )
Description When the user chooses the Insert menu item, this example compiles a SQL statement
for execution. To process any invalid SQL statements and trap the error (bypassing the default error
processing), add the “When SqlError” statement with a FALSE return before the SqlPrepare. When
SqlPrepare returns FALSE, call SqlError to get the error number, call SqlGetErrorTextX to get the error
description, and call SqlGetErrorPosition to get the character position where theSyntax error was detected.
SqlGetLastStatement
Syntax sSqlStatement = SqlGetLastStatement ()
Description Returns the last SQL statement passed to a SqlXxxx function for any cursor. The statement returned is
the same statement that would be shown in the default SQL Error dialog box.
Note: The statement is global for all cursors, therefore, if you get a SQL error after another cursor has had a statement
prepared the statement returned may not be the one prepared for the handle.
Parameters No parameters.
Description Returns the number of rows affected by the most recent INSERT, UPDATE, or DELETE statement.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlGetParameter
Syntax bOk = SqlGetParameter ( hSql, nParameter, nNumber,
strString )
Description Gets the value of a database parameter. This function returns the parameter value in nNumber or strString
as appropriate for the data type of the parameter.
nParameter Number. The database parameter. Specify one of the DBP_* constants.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_AppStartup
Call SqlGetParameter ( hSqlPrimary, DBP_LOCKWAITTIMEOUT,
nTimeout, strNull )
SqlGetParameterAll
Syntax bOk = SqlGetParameterAll ( hSql, nParameter, nNumber, strString, bNumber )
Description Gets the value of a database parameter identified by a SQLP* constant value defined in SQL.H. This
function returns the parameter value in nNumber or strString as appropriate for the data type of the
parameter.
Important: A set of the SQLP* constants in SQL.H have the same values as the DBP_* constants, but
the values identify different parameters. Be sure to specify the correct number.
nParameter Number. The database parameter. Specify the value of one of the SQLP*
constants defined in SQL.H.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlGetResultSetCount
Syntax bOk = SqlGetResultSetCount ( hSql, nCount )
Description Counts the rows in a result set by building the result set. Centura fetches each row that has not already been
fetched, returns a count of the rows, and positions the cursor back to its original position. Warning: this can
be time-consuming if the result set is large.
INSERTs into the result set increase the result set row count, but D ELETEs — which
display as blank rows in result set mode — do not decrease the row count. However, the deleted blank
rows disappear on the next SELECT. You must be in Result Set mode.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example Actions
Call SqlPrepare ( hSqlPrimary, strSqlTblWindow ) Call
SqlExecute ( hSqlPrimary ) Call SqlGetResultSetCount
( hSqlPrimary, nRowCount )
SqlGetRollbackFlag
Syntax bOk = SqlGetRollbackFlag ( hSql, bRollbackFlag )
Description Returns the database rollback flag. Use this function after an error to find out if a transaction rolled
back.
Centura sets the rollback flag when a system-initiated rollback occurs as the result of a deadlock or system
failure. Centura does not set the rollback flag on a user-initiated rollback.
Parameters hSql Sql Handle. The handle associated with the function call that got an error.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlImmediate
Syntax bOk = SqlImmediate ( strSqlCommand )
SqlImmediate actually performs a SqlConnect, a SqlPrepare, a SqlExecute, and for SELECT statements,
a SqlFetchNext. The first time you call SqlImmediate, Centura performs all of these functions. On later
calls, SqlConnect is not performed if not needed.
Use SqlImmediate with INSERT, UPDATE, DELETE, and other non-query SQL commands. You
can use SqlImmediate with a SELECT statement if you expect that
the statement only returns one row.
SqlImmediate manages Centura' internal handle. It uses the values of the SqlDatabase, SqlUser, and
SqlPassword system variables to connect to a database. Any command that you execute with
SqlImmediate, you can also execute with explicit calls to SqlConnect, SqlPrepare, SqlExecute or SqlOpen,
and SqlFetchNext, for SELECTs.
Parameters strSqlCommand String. The SQL statement to prepare and execute. This statement cannot
have more than 128 bind variables and more than 128 INTO variables.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlImmediateContext
Syntax bOk = SqlImmediateContext ( strSqlStatement )
Description Prepares and executes a SQL statement, and evaluates any bind or INTO variables in the context of the
window identified by hWndForm.
Call this function in a class to perform SQL processing for the current window without fully
qualifying bind and INTO variables. This function is also useful for global functions.
Important: When you call SqlImmediateContext, the context for bind variables and INTO variables is
always hWndForm. If you call SqlImmediateContext in an internal function, window function, or class
function, Centura does not recognize local variables or parameters that you use as bind variables and
INTO variables.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Description Names a cursor and executes a SQL statement. Use this function to perform INSERTs,
UPDATEs, and DELETEs on the current row. Call SqlOpen after SqlPrepare and before any of
the SqlFetch* commands.
Parameters hSql Sql Handle. The handle associated with the SqlPrepare.
strCursorName String. A string containing the cursor name. Specify this name in the
'CURRENT OF <cursor_name>' or 'ADJUSTING <cursor_name>' clause of
an INSERT, UPDATE, or DELETE statement.
The value of this parameter is case insensitive. You can set it to null using the
empty string ('').
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlPLSQLCommand
Syntax bOk = SqlPLSQLCommand ( hSqlHandle, strCommand )
Description Use this function to execute PL/SQL stored procedures in Centura. Call it once for each invocation of
PL/SQL.
The first argument identifies the SQL Handle to the database. The second parameter is a command string
used to invoke a PL/SQL stored procedure. Like a stored procedure call, this command string must have a
name.
You can use PL/SQL IN variables the same way you use any other parameter in SAL function calls.
PL/SQL OUT or IN/OUT variables must be valid SAL receive parameters and, like SAL receive
parameters, are set when the call returns. You can use arrays for IN, OUT, and IN/OUT parameters.
IN/OUT parameters can be made to pass data to the PL/SQL stored procedure and to receive data from a
PL/SQL stored procedure in the same parameter.
Note: The SqlPLSQLCommand supports Centura dynamic arrays as input, output and input/ output arguments to
Oracle7 PL/SQL stored procedures. Dynamic arrays of type NUMBER, STRING and DATE/TIME are supported.
Dynamic arrays grow to the size of the largest index value used in an assignment statement using the
dynamic array variables. For example: nDynvar[0] = 0 nnDynVar[1]= 1 nDynvar[9] = 9
When a dynamic array is passed as an INPUT argument to a PL/SQL stored procedure via
SqlPLSQLCommand the number of elements created on the front-end are available on the backend. Thus
in the backend stored procedure:
“insert into foo values(nDynVar(9))” will insert the value 9 into the table, while the statement
“insert into foo values(nDynVar(10))” will cause an error “Attempting to fetch beyond
end of result set”.
Uninitialized values
Dynamic array values are not initialized on the front-end, but falling within the range of a dynamic array
created on the front-end are passed as NULL for datatypes STRING and DATE/TIME and as zero for
datatype NUMBER. To pass NUMBER as a NULL, the user must explicitly assign them as NUMBER_Null
on the front-end;
The size of output arguments of type dynamic array is determined in the backend stored procedure .
Uninitialized values
Values for output arguments are not initialized on the backend, but are returned as NULL values.
INPUT / OUTPUT dynamic arrays behave as INPUT dynamic arrays on input and as OUTPUT dynamic
arrays on OUTPUT.
Parameters hSqlHandle Sql Handle. The connected SQL Handle to an Oracle database.
Return Value bOK is TRUE if the function succeeds and FALSE if it fails.
SqlPrepare
Syntax bOk = SqlPrepare ( hSql, strSqlStatement )
An INTO clause names where data is placed when it is fetched. These variables are
sometimes called INTO variables. You can specify up to 255 INTO variables per SQL
statement.
• Identifying bind variables in the SQL statement. Bind variables contain input data for the
statement. You can specify up to 2558 bind variables per SQL statement.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlPrepareAndExecute
Syntax bOk = SqlPrepareAndExecute ( hSql, strSqlStatement )
An INTO clause names where data is placed when it is fetched. These variables are
sometimes called INTO variables. You can specify up to 128 INTO variables per SQL
statement.
• Identifying bind variables in the SQL statement. Bind variables contain input data for the
statement. You can specify up to 128 bind variables per SQL statement.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
To execute the command, you need only call SqlExecute. You do not need to compile the command with
SqlPrepare because the command is compiled when it is stored with SqlStore.
strIntoList String. A comma-separated list of up to 128 Centura INTO variables. This list
has the same (or less) number of INTO variables as named in the SELECT
list of the compiled command. This string can be null (''), and should be null if
the next command being executed is SalListPopulate.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlSetInMessage
Syntax bOk = SqlSetInMessage ( hSql, nSize )
Description Sets the size (in bytes) of the input message buffer for the specified Sql Handle. The input message buffer
holds input for the application (such as the result of a query). There is one input message buffer per
connected Sql Handle on the client computer. The database server (or gateway) maintains one input
message buffer that is the size of the largest input message buffer on the client computer.
When fetching data, as many rows as possible are compacted into one input message buffer. Each FETCH
reads the next row from the input message buffer until they are exhausted. At this point, if you are accessing
a SQLBase database, SQLBase transparently fetches the next input buffer of rows depending on the
isolation level.
A large input message buffer can improve performance because it reduces the number of network messages
between the client and server. A large input message buffer can have a negative impact on concurrency,
however, because any row currently in the buffer can have a shared lock on it (depending on the isolation
level) which prevents other users from changing that row.
nSize Number. The size (in bytes) of the input message buffer that you want to set.
The default is 1 Kbyte and the maximum is 32 Kbtyes.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_AppStartup
Call SqlConnect ( hSqlPrimary ) Call SqlSetInMessage
( hSqlPrimary, 10000 )
SqlSetIsolationLevel
Syntax bOk = SqlSetIsolationLevel ( hSql, strIsolation )
Description Sets SQLBase's isolation level for all the application's cursors. Read
Changing isolation levels causes an implicit commit of the database. The isolation level you set applies
to all the Sql Handles for that user name that the application connects to the database.
strIsolation String. The isolation level to set. Specify one of these values: CS Cursor
Stability RL Release Locks RO Read Only RR Read Repeatability
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_AppStartup
Call SqlSetIsolationLevel ( hSqlPrimary, 'RL' )
SqlSetLockTimeout
Syntax bOk = SqlSetLockTimeout ( hSql, nTimeout )
Description Specifies the maximum time to wait to acquire a lock. After the specified time elapses, a timeout
occurs and the transaction rolls back.
Parameters hSql Sql Handle. A handle that identifies a database connection; the cursor on which
you want to set a lock timeout value.
nTimeout Number. The timeout period in seconds. Valid values include 1 (wait forever),
0 (never wait), and values up to and including 1800 (30 minutes). The default
is 300.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
( hSqlPrimary, 10 )
SqlSetLongBindDatatype
Syntax bOk = SqlSetLongBindDatatype( nBindVarNumber, nDatatype )
Description Sets the type of column (text or binary) that a Long String binds to. By default, Centura binds Long Strings
to text columns. However, when you write or update a long binary column, call SqlSetLongBindDatatype
and set the nDatatype parameter to binary (value = 23). Later you can set the type back to text by calling
this function and setting nDatatype to text (value = 22). Value = 24 is for Informix and Ingres specific
routers.
Call this function before executing the SQL statement (implicitly or explicitly) because Centura
compiles bind variables at execute time.
Use this function until Centura Software Corporation implements a native SAL binary long data type.
Parameters nBindVarNumber Number. The bind variable to set. The first bind variable in the SQL statement
is 1, the second is 2, and so on.
text 23 = binary
SqlSetOutMessage
Syntax bOk = SqlSetOutMessage ( hSql, nSize )
Description Sets the size (in bytes) of the output message buffer for a specified Sql Handle. The output message buffer
holds output from the application (such as a SQL command to compile or rows of data to insert into a
database).
There is an output message buffer for each connected Sql Handle on the client computer. At the same time,
the database server (or gateway) maintains an output message buffer that is the size of the largest of its
clients' output message buffers. A large output message buffer does not necessarily improve performance
because the buffer only needs to be large enough to hold the largest SQL command to compile or the largest
row of data to insert. (Rows are always sent to the database and inserted individually.) A large output
message buffer can allocate space unnecessarily on both the client and the server, and it does not reduce
network traffic.
nSize Number. The size (in bytes) of the output message buffer. The default is 1
Kbyte and the maximum is 32 Kbytes.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
Example On SAM_AppStartup
Call SqlConnect ( hSqlPrimary ) Call SqlSetOutMessage ( hSqlPrimary,
1500 )
SqlSetParameter
Syntax bOk = SqlSetParameter ( hSql, nParameter, nNumber, strString )
Description Sets the value of a database parameter. Use the number (nNumber) and string (strString)
arguments as appropriate for the data type of the parameter.
nParameter Number. The database parameter to set. Specify one of the DBP_*
constants.
nNumber Number. The value of nParameter. Specify TRUE or FALSE for all but
DBP_LOCKWAITTIMEOUT, for which you must specify a value in seconds.
SqlSetParameterAll
Syntax bOk = SqlSetParameterAll ( hSql, nParameter, nNumber, strString, bNumber )
Description Sets the value of a database parameter identified by a SQLP* constant value defined in SQL.H. This
function uses the number (nNumber) and string (strString) parameters as appropriate depending on the
data type of the value of the parameter.
Parameters hSql Sql Handle. The handle that identifies a database connection.
nParameter Number. The database parameter to set. Specify the value of one of the
SQLP* constants defined in SQL.H.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlSetResultSet
Syntax bOk = SqlSetResultSet ( hSql, bSet )
by default in Centura.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
SqlStore
Syntax bOk = SqlStore ( hSql, strName, strSqlCommand )
You do not need to call SqlPrepare before calling SqlStore. SqlStore compiles the SQL statement.
You can specify up to 128 bind variables. Use numeric bind variables in the SQL statement, not
variable names. For example: "SELECT * FROM PRESIDENT WHERE LASTNAME = :1 AND AGE >
:2;".
When you retrieve the stored command with SqlRetrieve, you specify the bind variable names in the INTO
clause. For example, specify ‘:dfLastName’ and ‘:dfAge’ where dfLastName and dfAge are data fields on a
form window. Before Centura performs a SQL execute or fetch operation, it compiles the bind and into
variables which is looking up the symbols and generating the code that gets the values (for bind variables)
or that fetches the values (for an into variable). By default, Centura compiles:
You can change this default behavior by calling SqlVarSetup which saves the current execution context.
When you execute or fetch later, Centura uses that execution context to resolve references to bind variables
and into variables. This means that you can use bind and into variables in a different context than where you
call Sql* functions. You must call SqlPrepare for the Sql Handle before you call SqlVarSetup. Use this
function to write:
• Global functions that store bind and into variables in local variables
• A hierarchy of classes where a base class can prepare and fetch and a derived class can specify
the into variables
This function does not affect the lifetime of the bind and into variables and does not guarantee that the
variables will exist when you execute or fetch. You must ensure that the variables are still valid when you
use them.
Return Value bOk is TRUE if the function succeeds and FALSE if it fails.
VisArrayAppend
Syntax nNumItems = VisArrayAppend ( hArySource, hAryTarget, nDataType) Number | String |
Date/Time: hArySource[*] Number | String | Date/Time: hAryTarget[*] Number:
nDataType
Description Appends one array onto the end of another array. The source and target arrays must be defined as dynamic
arrays, must be the same data type, and cannot be multidimensional arrays.
Parameters hArySource Source array to append onto the end of the target.
hAryTarget Target array, source array will be appended onto this array.
Return Number: The number of total items in the target array after the append operation, if successful, or
negative if an error occurs.
Example Variables:
String: sSource[*]
String: sTarget[*]
... Actions
VisArrayCopy
Syntax nNumItems = VisArrayCopy ( hArySource, hAryTarget, nDataType) Number | String |
Date/Time: hArySource[*] Number | String | Date/Time: hAryTarget[*] Number:
nDataType
Description Copies one array into another. After this call the two arrays will be identical. The source and target arrays
must be defined as dynamic arrays, must be the same data type, and cannot be multi-dimensional arrays.
hAryTarget Target array, source array will be copied into this array, replacing its
current contents.
Return Number: The number of items in the target array, if successful, or negative if an error occurs.
Example Variables:
String: sSource[*]
String: sTarget[*]
... Actions
Description Deletes an item from an array. All subsequent items will be moved up in the array. The array cannot be
a multi-dimensional array.
Return Number: The number of items in the array after the deletion, if successful, or negative if an error occurs.
Example Variables
String: sString[*]
... Actions
VisArrayFillDateTime
Syntax bOk = VisArrayFillDateTime ( dtDateTimes, dtValue, nCount) Date/Time:
dtDateTimes[*] Date/Time: dtValue Number: nCount
Description Fills a Date/Time array with a specified date/time value. This function is useful for initializing an array.
The array cannot be a multi-dimensional array.
Example Variables
Date/Time: dtSample[*]
... Actions
VisArrayFillNumber
Syntax bOk = VisArrayFillNumber ( nNumbers, nValue, nCount) Number:
nNumbers[*] Number: nValue Number: nCount
Description Fills a number array with a specified value. This function is useful for initializing an array. The array
cannot be a multi-dimensional array.
Example Variables
Number: nSample[*]
... Actions
VisArrayFillString
Syntax bOk = VisArrayFillString ( sStrings, sValue, nCount) String:
sStrings[*] String: sValue Number: nCount
Description Fills a string array with a specified string. This function is useful for initializing an array. The array
cannot be a multi-dimensional array.
Example Variables
String: sSample[*]
... Actions
VisArrayFindDateTime
Syntax nIndex = VisArrayFindDateTime ( dtDateTimes, dtSearchFor) Date/Time:
dtDateTimes[*] Date/Time: dtSearchFor
Description Locates a date/time value within an array. The array cannot be a multi-dimensional array.
Return Number: The index of the item found, if successful, or negative if not found.
Variables
Date/Time: dtMyDates[*]
Number: nIndex
... Actions
VisArrayFindNumber
Syntax nIndex = VisArrayFindNumber ( nNumbers, nSearchFor) Number:
nNumbers[*] Number: nSearchFor
Description Locates a number within an array. The array cannot be a multi-dimensional array.
Return Number: The index of the item found, if successful, or negative if not found.
Variables
Number: nMyNumbers[*]
Number: nIndex
... Actions
Else
VisArrayFindString
Syntax nIndex = VisArrayFindString ( sStrings, sSearchFor) String:
sStrings[*] String: sSearchFor
Description Locates a string within an array. The entire specified string is compared to each array item. The array
cannot be a multi-dimensional array.
Return Number: The index of the item found, if successful, or negative if not found.
Example Variables
Number: nMyString[*]
Number: nIndex
... Actions
Else
Description Inserts an item into an array. All subsequent items will be moved down in the array. The inserted item is
initialized to a null value. The array cannot be a multidimensional array.
Return Number: The number of items in the array after the insertion, if successful, or negative if an error
occurs.
Related Functions
VisArrayDeleteItem
Example Variables
String: sString[*]
... Actions
(sString, 3, DT_String)
VisArraySort
Syntax nNumItems = VisArraySort ( hAry, nSortOrder, nDataType) Number |
String | Date/Time: hAry[*] Number: nSortOrder Number: nDataType
Description Sorts an array in either ascending or descending order. The array cannot be a multidimensional array.
SORT_Ascending
SORT_Descending
nDataType Indicates the data type for the array.
Return Number: The number of items in the array, if successful, or negative if an error occurs.
Example Variables
String: sDirs[*]
... Actions
VisDebugAssert
Syntax bOk = VisDebugAssert ( bExpression, sDebugString) Boolean:
bExpression String: sDebugString
Description Asserts that a condition is true. If expression is FALSE, the debug message specified will be displayed in a
message box. This function is typically used in a development environment to provide an indication that an
internal, potentially fatal, error occurred.
sDebugString Debug message to display if condition is FALSE. The Centura name of the
current window will be prepended to sDebugString before displaying.
Example Variables
Window Handle: hWnd
... Actions
Parameters No parameters.
Related Functions
VisDebugEndTime, VisDebugSetTime
Example Actions
Call VisDebugBeginTime ()
Call SqlPrepare (hSql, 'Select...') Call
VisDebugSetTime ('SqlPrepare') Call
SqlExecute (hSql)
Call VisDebugSetTime ('SqlExecute')
VisDebugEndTime
Syntax bOk = VisDebugEndTime ( sContext, nDebugLevel) String: sContext Number:
nDebugLevel
Description Stops recording the time and displays all incremental times and the total time. All times are displayed in
the debug application window (DBWIN.EXE) or in a message box depending on the current debug flags.
nDebugLevel Minimum debug level before performance time will be displayed. Specify zero
to always display the message. Typically, the higher the debug level, the
greater the number of debug messages displayed.
Related Functions
VisDebugBeginTime, VisDebugSetTime
Example Actions
Call VisDebugBeginTime () Call
SqlPrepare (hSql, 'Select...')
VisDebugGetFlags
Syntax nDebugFlags = VisDebugGetFlags ()
Parameters No parameters.
Return Number: The current debug bit flags. To test a bit flag, use the bitwise AND (&) operator.
DBF_IncrementalTime
DBF_RealTime
DBF_MessageBox
Related Functions
VisDebugSetFlags
Example Variables
Number: nDebugFlags
... Actions
VisDebugSetFlags
Syntax bOk = VisDebugSetFlags ( nDebugFlags, bMode) Number: nDebugFlags Boolean: bMode
Parameters nDebugFlags Bit flags to set or clear. May be any of the following:
DBF_IncrementalTime
Related Functions
VisDebugGetFlags
Example Actions
Call VisDebugSetFlags (DBF_MessageBox, TRUE)
VisDebugSetLevel
Syntax bOk = VisDebugSetLevel ( nDebugLevel) Number: nDebugLevel
Description Sets the current debug level. The debug level allows selective debug messages to be displayed.
Parameters nDebugLevel Current debug level. Debug messages must be equal or greater than the current
debug level to be displayed.
Example Actions
Call VisDebugSetLevel (0)
VisDebugSetTime
Syntax bOk = VisDebugSetTime ( sContext) String:
sContext
Description Records the time since the last VisDebugSetTime or VisDebugBeginTime call. This
function records an incremental time. The time will not be displayed in the debug application until a VisDebugEndTime
call is made. The context string will be displayed to the left of the time.
Related Functions
VisDebugBeginTime, VisDebugEndTime
VisDebugString
Syntax bOk = VisDebugString ( sDebugString, nDebugLevel) String:
sDebugString Number: nDebugLevel
Description Writes a string to the debug application window. If the debug application is not
running, this function performs no action. If the DBF_MessageBox flag is set, a message box will be
displayed.
nDebugLevel Debug level. Specify zero to always display the message. Typically, the higher
the debug level, the greater the number of debug messages displayed.
Related Functions
VisDebugSetLevel
Call VisDebugString
('SAM_Click in pbOk', 0)
VisDosBuildFullName
Syntax sFullName = VisDosBuildFullName ( sModuleName, sFileName) String:
sModuleName String: sFileName
Description Builds a file name with drive and full directory based on the location of a running executable. The path of
the result file is the location of the executable when Windows loaded it into memory. The directory structure
on disk is not used in any way to build the path. This function may be used to locate supplemental files (i.e.
INI files, etc.) without a DOS PATH established to the application. This function does not check for the
existence of the full file name returned.
Parameters sModuleName Module name to use for building the full file name. Specify just the base
name, no drive, path, or extension. This name must be the base name of a
loaded EXE or DLL file.
Return String: A string containing the full file name (drive, path, and file name), or a null string if an error
occurs.
Example Variables
String: sFileName
... Actions
VisDosEnumDirInfo
Syntax nNumDirs = VisDosEnumDirInfo ( sDirSpec, sDirs, dtDateTimes, nAttributes) String: sDirSpec
Receive String: sDirs[*] Receive Date/Time: dtDateTimes[*] Receive Number: nAttributes[*]
Description Retrieves all subdirectories for a given directory into a Centura array, also returns the date/time the
directory was created and the attributes of the directory.
Returns Number: The number of items returned in sDirs, dtDateTimes and nAttributes, or
negative if an error occurs.
Related Functions
VisDosEnumFileInfo
Example Variables
String: sDirs[*]
Date/Time: dtDateTimes[*]
Number: nAttributes[*]
...
Actions
VisDosEnumDirs
Syntax nNumDirs = VisDosEnumDirs ( sDirSpec, sDirs) String:
sDirSpec Receive String: sDirs[*]
Description Retrieves all subdirectories within a given directory into a Centura array.
Parameters sDirSpec Directory to search, may include wildcard characters (? and *). It must be a
valid DOS path. If no drive or directory is specified, the current drive and/or
directory is used. Use a double backslash (\\) to represent a single backslash.
sDirs Array to contain the subdirectories. Note that only directory names are
returned, no leading or trailing backslashes.
Return Number: The number of subdirectories returned into the specified array, or negative if an error occurs.
Related Functions
VisDosEnumDrives, VisDosEnumFiles
Example Variables
Number: nCount
String: sDirs[*]
...
Actions
Set nCount = VisDosEnumDirs (' c:\\windows\\*.*', sDirs)
If nCount > 0
Call VisListArrayPopulate (lbDirs, sDirs)
VisDosEnumDrives
Syntax nNumDrives = VisDosEnumDrives ( sDrives) Receive
String: sDrives[*]
Description Retrieves all available drives into a Centura array, including floppy drives, hard disks, CD-ROM, network
and RAM drives. To determine the type of each drive, call
VisDosGetDriveType.
Return Number: The number of available drives returned in the specified array.
Related Functions
VisDosEnumDirs, VisDosEnumFiles
Example Variables
Number: nCount
String: sDrives[*]
... Actions
If nCount > 0
Call VisListArrayPopulate (lbDrives)
VisDosEnumFileInfo
Syntax nNumFiles = VisDosEnumFileInfo ( sDirSpec, nAttribute, sFiles, nSizes, dtDateTimes,
nAttributes) String: sDirSpec Number: nAttribute
Description Retrieves all files in a given directory into a Centura array, and returns each file's size, date/time, and
attributes. If the source drive supports long file names, then the long name will be returned.
nAttribute Attribute bits to match. See the table below for a list of attributes.
nAttributes Array to contain the attributes of each file. May be one or more of the following
values: FA_Standard
FA_ReadOnly
FA_Hidden
FA_System
FA_Archive
Returns Number: The number of subdirectories returned in the specified array, or negative if an error occurs.
Related Functions
VisDosEnumDirInfo
Example Variables
String: sFiles[*] Number: Sizes[*]
Date/Time: dtDateTimes[*]
ν umber: nAttributes[*]
...
Actions
Set nCount = VisDosEnumFileInfo ('c:\\windows\\*.*',
FA_Standard, sFiles, nSizes, dtDateTimes, nAttributes) If nCount >0
...
VisDosEnumFiles
Syntax nNumFiles = VisDosEnumFiles ( sFileSpec, nAttributes, sFiles) String:
sFileSpec Number: nAttributes Receive String: sFiles[*]
Description Retrieves all file names from a given directory into a Centura array. If the drive supports long file
names, then the long name will be returned.
Parameters sFileSpec Directory to search, may include wildcard characters (? and *). It must be a
valid DOS path. If no drive or directory is specified, the current drive and/or
directory is used. Use a double backslash (\\) to represent a single
backslash.
nAttributes Attributes bits to match. This parameter may be one or more of the following
values: FA_Standard FA_ReadOnly FA_Hidden
Return Number: The number of files returned in the specified array, or negative if an error occurs.
Related Functions
VisDosEnumDirs, VisDosEnumFiles
Example Variables
Number: nCount
String: sFiles[*]
... Actions
VisDosEnumNetConnections
Syntax nNumLinks = VisDosEnumNetConnections ( sDevices, sNetNames) Receive String:
sDevices[*] Receive String: sNetNames[*]
Description Retrieves all current network connections. Both sDevices and sNetNames will contain
the same number of elements. The network name consists of a computer name and a share name, and may
also include a path. The computer name uniquely identifies the network server, while the share name
identifies the resource. If a path is given, it uniquely identifies a directory or file. For example,
\\server\data\path, \\servers\laser. This follows the standard DOS naming convention for network devices.
Related Functions
VisDosNetConnect, VisDosNetDisconnect
Example Variables
Number: nCount String:
sDevices[*] String:
sNetPaths[*]
... Actions
VisDosEnumPath
Syntax nNumPaths = VisDosEnumPath ( sDirs) Receive
String: sDirs[*]
Description Returns each directory in the DOS PATH environment string. Any nonexistent directories on the path are not
returned. DOS does not support directories on the path with trailing backslashes. If a path directory contains
a trailing backslash, it is not returned.
A trailing backslash is added to each directory returned. This trailing backslash is helpful for scanning
all path directories for a particular file. To scan, simply concatenate *.* onto the end of each directory
returned and call VisDosEnumFiles.
Related Functions
VisDosEnumFiles
Example Variables
String: sDirs[*]
... Actions
If nCount > 0
Call VisListArrayPopulate (lbPath, sDirs)
Description Retrieves all long and short subdirectory names for a given directory into a Centura array, also returns the
date/time the directory was created and the attributes for that directory.
Parameters sDirName Parent Directory to retrieve subdirectory information from. Must include
wildcard characters.
Return Returns the number of subdirectories in the arrays or negative if an error occured.
Related Functions
VisDosEnumsShortDirs
VisDosEnumsShortFileInfo
VisDosEnumsShortFiles
VisDosIsParent
VisDosEnumsShortDirs
Syntax nSubDirNum = VisDosEnumsShortDirInfo ( sDirName, arrLongDirNames, arrShortDirNames )
Description Retrieves all long and short subdirectory names for a given directory into a Centura array.
Parameters sDirName Parent Directory to retrieve subdirectory information from. Must include
wildcard characters.
Return Returns the number of subdirectories in the arrays or negative if an error occured.
Related Functions
VisDosEnumsShortDirInfo
VisDosEnumsShortFileInfo
VisDosEnumsShortFiles
VisDosIsParent
VisDosEnumsShortFileInfo
Syntax nSubFileNum = VisDosEnumsShortFileInfo ( sDirName, nAttribBits, arrLongFileNames,
arrShortFileNames, arrSizes, arrDateTime, arrAttribs )
Description Retrieves all long and short file names for a given directory into a Centura array, also returns each of the
files sizes, date/time and attributes.
Parameters sDirName Directory to retrieve file information from. Must include wildcard
characters.
Return Returns the number of files in the arrays or negative if an error occured.
Related Functions
VisDosEnumsShortDirInfo
VisDosEnumsShortDirs
VisDosEnumsShortFiles
VisDosIsParent
Description Retrieves all long and short file names for a given directory into a Centura array.
Parameters sDirName Directory to retrieve file information from. Must include wildcard
characters.
Return Returns the number of files in the arrays or negative if an error occured.
Related Functions
VisDosEnumsShortDirInfo
VisDosEnumsShortDirs
VisDosEnumsShortFileInfo
VisDosIsParent
VisDosExist
Syntax bOk = VisDosExist ( sFileSpec) String: sFileSpec
Description Tests for existence of a drive, directory, or file. If a directory is tested, any trailing backslash is
ignored. If wildcards are used, files and directories are searched.
Parameters sFileSpec Drive, directory, or file to test. It may contain a drive letter, directory, file
name, full path or wildcard characters (? and *).
VisDosGetCurDir
Syntax sDir = VisDosGetCurDir ( sDrive)String: sDrive
Parameters sDrive Drive letter (A:-Z:) to retrieve the current directory for.
Return String: The current directory of the drive specified. If the drive is invalid, a null string is returned. The
returned directory always contains the drive letter, path and a trailing backslash.
Example Variables
String: sCurDir
...
Actions
Set sCurDir = VisDosGetCurDir (VisDosGetCurDrive())
If VisDosEnumFiles (sCurDir || '*.*',FA_Standard, sFiles)
VisListArrayPopulate (lbFiles, sFiles)
VisDosGetDriveSize
Syntax nErrCode = VisDosGetDriveSize ( sDrive, nTotalSpace, nFreeSpace) String: sDrive
Parameters sDrive Drive letter to retrieve space information for, may include both a drive letter
and colon.
Related Functions
VisDosEnumDrives, , VisDosGetDriveType
Example Variables
Number: nTotalSpace Number:
nAvailableSpace
... Actions
VisDosGetDriveType
Syntax nTypeFlags = VisDosGetDriveType ( sDrive) String:
sDrive
Parameters sDrive Drive letter to retrieve space information for, may include both a drive letter
and colon.
Return Number A flag indicating the drive type, or negative if an error occurs. DRIVE_Floppy
DRIVE_Fixed DRIVE_Network DRIVE_CDROM DRIVE_RAM
Related Functions
VisDosEnumDrives, VisDosGetDriveSize
nType
...
Actions Set nType = VisDosGetDriveType
('c:')
Select Case nType Case
DRIVE_Floppy
...
Break Case
DRIVE_Fixed
...
Break
VisDosGetEnvString
Syntax sEnvString = VisDosGetEnvString ( sKeyName) String:
sKeyName
Description Returns an environment string based on a keyword. The keyword is the text before the = sign in the
environment. For example, PATH = C:\DOS.
Return String: The environment variable contents. If the keyword cannot be found, a null string is returned.
Example Variables
String: sTempDir
...
Actions
Set sTempDir = VisDosGetEnvString ('TEMP')
VisDosGetFlags
Syntax nFlags = VisDosGetFlags ()
Parameters No parameters.
Return Number Any of the following bit flags. To test a bit value, use the bitwise AND
(&) operator.
Related Functions
VisDosSetFlags
nFlags
...
Actions Set nFlags =
VisDosGetFlags ()
If nFlags & DOS_VerifyFlag
...
If nFlags & DOS_BreakFlag
Description Retrieves the network name for the specified device. The network name consists of a computer name and a
share name, and may also include a path. The computer name uniquely identifies the network server, while
the share name identifies the resource. If a path is given, it uniquely identifies a directory or file. For
example, \\server\data\path, \\servers\laser. This follows the standard DOS naming convention for network
devices.
Return String: The network name, if successful, or a null string if an error occurs.
Related Functions
VisDosEnumNetConnections, VisDosNetConnect, VisDosNetDisconnect
Example Variables
String: sNetName
...
Actions
Set sNetName = VisDosGetNetName (' f:')
VisDosGetVersion
Syntax nVersionNum = VisDosGetVersion ()
Parameters None.
Return Number: Both the major and minor (3.31) DOS version number.
Example Variables
Number: nVersion
...
Actions
Set nVersion = VisDosGetVersion ()
VisDosGetVolumeLabel
Syntax sLabel = VisDosGetVolumeLabel ( sDrive) String:
sDrive
Return String: The volume label of the specified drive, or negative if an error occurs.
Related Functions
VisDosSetVolumeLabel
sLabel
...
Actions Set sLabel =
VisDosGetVolumeLabel ('c:')
VisDosIsParent
Syntax bOk = VisDosIsParent ( sDirSpec) String:
sDirSpec
Related Functions
VisDosEnumsShortDirInfo
VisDosEnumsShortDirs
VisDosEnumsShortFileInfo
VisDosEnumsShortFiles
Description Creates all directories along the full path specified. For example, if c:\stuff\junk\newone is
specified, the stuff, junk and newone directories are all created, if necessary.
Parameters sDir Directory name to create, may contain a drive letter and/or full path. If path not
specified, directory will be created on the current drive under the current
directory. If sDir contains a
trailing backslash, it is ignored.
('c:\\stuff\\junk\\newone') != VTERR_Ok
Call SalMessageBox ('Cannot create directory', 'Error',
MB_Ok)
VisDosMakePath
Syntax sFileSpec = VisDosMakePath ( sDrive, sDir, sBase, sExt) String: sDrive
String: sDir String: sBase String: sExt
Description Builds a full path from a drive, directory or file name. No existence check is performed on the
result string.
sDir Directory.
Return String: The path after concatenating the drive, directory, and file name.
Related Functions
VisDosSplitPath
Example Actions
Set sFullName = VisDosMakePath (' c:', '\\dos\\', 'command',
'.com')
VisDosNetConnect
Syntax nErrCode = VisDosNetConnect ( sDevice, sNetName, sPassword) String: sDevice
String: sNetName String: sPassword
Description Connects to a network device. The network name consists of a computer name and a share name, and may
also include a path. The computer name uniquely identifies the network server, while the share name
identifies the resource. If a path is given, it uniquely identifies a directory or file. For example,
\\server\data\path, \\servers\laser. This follows the standard DOS naming convention for network devices.
Related Functions
VisDosEnumNetConnections, VisDosNetDisconnect
('f:','\\\\server\\data', 'cubswin')
!= VTERR_Ok
VisDosNetDisconnect
Syntax nErrCode = VisDosNetDisconnect ( sDevice, bForce) String:
sDevice Boolean: bForce
Related Functions
VisDosNetConnect
('f:', TRUE)
Parameters nFlags Bits indicating flags to set. May be any combination of the following values. To
combine bit values, use the bitwise OR (|) operator.
bState TRUE to turn the flag on, FALSE to turn the flag off.
Related Functions
VisDosGetFlags
(DOS_VerifyFlag, TRUE)
VisDosSetVolumeLabel
Syntax nErrCode = VisDosSetVolumeLabel ( sDrive, sLabel) String: sDrive
String: sLabel
Related Functions
VisDosGetVolumeLabel
VisDosSplitPath
Syntax Void VisDosSplitPath ( sFileSpec, sDrive, sDir, sBase, sExt) String:
sFileSpec Receive String: sDrive Receive String: sDir Receive String:
sBase Receive String: sExt
Description Splits a full path specification into drive, directory, and file name. The end of the directory is located by
searching backward for the last backslash. For example, c:\dos will be split into c:, \, and dos.
Related Functions
VisDosMakePath
String: sFile
...
Actions Call VisDosSplitPath
('c:\\windows\\user.exe', sDrive,
‘ sDir, sFile, sExt) !
Description Displays an error message and allows the user to free resources and retry the operation. This function
should be called when a recoverable error has occurred. A recoverable error is caused by a temporary lack
of resources, such as memory or disk space.
Return Number: An action code depending on whether the user choose Retry or Abort pushbuttons:
VisFileAppend
Syntax nErrCode = VisFileAppend ( sSourceFile, sTargetFile) String:
sSourceFile String: sTargetFile
Description Appends one or more files to another. Wildcard characters are supported in the source file name. If wildcard
character(s) are used, all matching files will be appended onto the target file.
sTargetFile Target file name. If this file does not exist, an error is returned. File name
specified may be in long format or in DOS 8.3 format.
Related Function s
VisFileCopy, VisFileRename
VisFileClose
Syntax nErrCode = VisFileClose ( hFile) File
Handle: hFile
Description Closes a file opened with the VisFileOpen call. Cannot be used with a file handle
returned from SalFileOpen.
Related Functions
VisFileOpen
VisFileCopy
Syntax nErrCode = VisFileCopy ( sSourceFile, sTargetFile) String:
sSourceFile String: sTargetFile
Description Copies one or more files. Wildcard characters are supported in both the source and target file names. If
wildcards are used in the target, they must also be used in the same manner in the source. All attributes
and date/times are preserved from the source to the target. This function operates up to 7 times faster
than SalFileCopy.
Parameters sSourceFile Source file to copy. File name specified may be in long format or in DOS 8.3
format.
sTargetFile Target file to copy to or directory to copy into. Trailing backslashes are ignored.
If a file is specified for copy, the source file is renamed. If wildcards are used,
the source names are used to fill in the target names.
Related Functions
VisFileAppend, VisFileRename
Description Creates a temporary file. If successful, this function creates the file name returned. Temporary files are
created in the directory pointed to by the TEMP environment variable. If no TEMP environment variable
is set, the file is created in the root directory of the current drive.
Parameters sPrefix The prefix is used to build the file name. A temporary file name contains a tilde
character (~), the prefix, a random number and the extension TMP. Only the
first 3 characters of the prefix are used, the rest are ignored.
Return String: A string containing drive, directory, and file name of the temporary file.
VisFileDelete
Syntax nErrCode = VisFileDelete ( sFileSpec) String:
sFileSpec
Parameters sFileSpec Directory and file specification to delete, may include wildcard characters. File
name specified may be in long format or in DOS 8.3 format.
VisFileExpand
Syntax nErrCode = VisFileExpand ( sSourceFile, sTargetFile) String:
sSourceFile String: sTargetFile
Description Copies a source file to a destination file. If the source file was compressed by COMPRESS.EXE (Microsoft
SDK), this function creates a decompressed destination file. If the source was not compressed, this
function duplicates the source file.
Parameters sSourceFile Source file specification to expand. May include wildcard characters (? and *).
File name specified may be in long format or in DOS 8.3 format.
sTargetFile Target file specification. May also include wildcard characters. File name
specified may be in long format or in DOS 8.3 format.
Related Functions
VisFileFind
Syntax sFullName = VisFileFind ( sFileName) String:
sFileName
Description Searches for a file in the following locations and returns the full path to the file:
1. Current directory
Parameters sFileName File name to search for. Cannot contain wildcard characters. File name
specified may be in long format or in DOS 8.3 format.
Return String: The full path if the file name is found. A null string is returned if the file cannot be found.
VisFileGetAttribute
Syntax nAttribute = VisFileGetAttribute ( sFileName) String:
sFileName
Description Gets the attribute bit values for the specified file.
Parameters sFileName File name to obtain attribute bits for. Cannot include wildcards. File name
specified may be in long format or in DOS 8.3 format.
Related Functions
VisFileGetSize, VisFileSetAttribute
VisFileGetSize
Syntax nFileSize = VisFileGetSize ( sFileName) String:
sFileName
Parameters sFileName File name to get size of. File name specified may be in long format or in
DOS 8.3 format.
Related Functions
VisFileGetAttribute
VisFileGetType
Syntax nFileType = VisFileGetType ( sFileName) String:
sFileName
Description Gets the file type. A file can be only one type.
Parameters sFileName File name to obtain type of. File name specified may be in long format or in
DOS 8.3 format.
Return Number: The file type, or negative if an error occurs. File types are mutually exclusive and valid
values are:
Related Functions
VisFileGetAttribute, VisFileGetSize
VisFileOpen
Syntax nErrCode = VisFileOpen ( hFile, sFileName, nFlags) Receive File
Handle: hFile String: sFileName Number: nFlags
Description Creates or opens a file. A file must be opened before it can be read or written to.
sFileName File name to open. File name specified may be in long format or in DOS 8.3
format. If only a file name is given, this function searches the following
directories:
1) Current directory
2) Windows or Windows System directories
3) Directory containing currently running executable
4) Directories in PATH environment variable
nFlags Specifies the style in which the file is to be opened. To combine bit values,
use the bitwise OR (|) operator. Options include: OF_Append OF_Binary
OF_Cancel OF_Create OF_Delete OF_Exist OF_Parse OF_Prompt OF_Read
OF_ReadWrite OF_Share_Deny_Compat OF_Share_Deny_Exlcusive
OF_Share_Deny_None OF_Share_Deny_Read OF_Share_Deny_Write
OF_Text OF_Verify OF_Write
VisFileClose
Example Variables
File Handle: hFile
String: sLine
... Actions
VisFileRead
Syntax nBytesRead = VisFileRead ( hFile, sBuffer, nSize) File Handle:
hFile Receive String: sBuffer Number: nSize
Description Reads a block of data from a file. See Chapter 2, Programming Techniques , of your
documentation for an explanation of the difference between VisFileRead and
SalFileRead.
Return Number: The number of bytes actually read. If return is less than nSize, the end of file
was reached. Negative if an error occurs.
Related Functions
VisFileOpen, VisFileWrite
VisFileReadString
Syntax nErrCode = VisFileReadString ( hFile, sLine) File
Handle: hFile Receive String: sLine
Description Reads a text line from a text file into a string. The text file must indicate the end of each line by carriage
return/line feed characters. The CR/LF characters are removed from the string.
sLine Text line read from the file. Pre-allocation of the sLine with
SalStrSetBufferLength is not necessary.
Related Functions
VisFileRename
Syntax nErrCode = VisFileRename ( sOldFileSpec, sNewFileSpec) String:
sOldFileSpec String: sNewFileSpec
Description Renames one or more files. Wildcard characters are supported in both the source and target file names. If
the source and target directories are different but the file names are the same, the files are moved to the
target directory specified.
Parameters sOldFileSpec Source file specification to rename. File name specified may be in long
format or in DOS 8.3 format.
sNewFileSpec Target file specification. File name specified may be in long format or in
DOS 8.3 format.
VisFileSeek
Syntax nErrCode = VisFileSeek ( hFile, nOffset, nOrigin) File Handle:
hFile Number: nOffset Number: nOrigin
nOffset Specifies the number of bytes the offset is to be moved from the origin.
nOrigin Specifies the direction of the offset. May be any of the following
values: SEEK_Begin SEEK_Current SEEK_End
Return Number: The current offset in file if successful, or negative if an error occurs.
Related Functions
VisFileOpen, VisFileTell
(hFile, 0, SEEK_End)
...
Call VisFileClose (hFile)
VisFileSetAttribute
Syntax nErrCode = VisFileSetAttribute ( sFileName, nAttribute, bState) String:
sFileName Number: nAttribute Boolean: bState
Parameters sFileName Directory and file specification to set, may include wildcard characters. If
wildcard characters are used, the attributes are set for each matching file. File
name specified may be in long format or in DOS 8.3 format.
Related Functions
VisFileGetAttribute, VisFileSetDateTime
VisFileSetDateTime
Syntax nErrCode = VisFileSetDateTime ( sFileName, dtDateTime) String:
sFileName Date/Time: dtDateTime
Description Sets the date and time for one or more files.
Parameters sFileSpec Directory and file specification to set, may include wildcard characters. If
wildcard characters are used, the date and time are set for each matching file.
File name specified may be in long format or in DOS 8.3 format.
Return Number: The current offset in file if successful, or negative if an error occurs.
Related Functions
VisFileOpen, VisFileSeek
Example Actions
Set nFilePos = VisFileTell (hFile)
VisFileWrite
Syntax nErrCode = VisFileWrite ( hFile, sBuffer, nSize) File Handle:
hFile String: sBuffer Number: nSize
Description Writes a block of data to a file.The maximum number of characters you can write is
65,535.
Return Number: The number of bytes written to the file. If the return value is less than nSize,
the drive is out of space. Negative if an error occurs.
Related Functions
VisFileOpen, VisFileWriteString
VisFileWriteString
Syntax nErrCode = VisFileWriteString ( hFile, sLine) File Handle:
hFile String: sLine
Description Writes a string to a file. CR/LF characters are added to the end of the string before it's
written to the file.
Related Functions
VisFileOpen, VisFileWrite
VisFontEnum
Syntax nNumFonts = VisFontEnum ( sGetFlag, sFontNames, nFontTypes) String: sGetFlag
Description Gets the font names and types (printer, true type, etc.).
Parameters sGetFlag One or more flags indicating type of fonts to retrieve. To combine bit
values, use the bitwise OR (|) operator. FONT_GetScreen
FONT_GetPrinter
sFontNames Names of each available font (Arial, Times New Roman, etc.)
nFontTypes Bit flags indicating types of each available font. To combine bit values, use
the bitwise OR (|) operator. FONTTYPE_Device FONTTYPE_Raster
FONTTYPE_TrueType
Return Number: The total number of fonts if successful, or negative if an error occurs.
VisFontGet
nIndex = 0
VisFontFree
Syntax bOk = VisFontFree ( hFont) String:
hFont
Description Frees a font loaded into memory with the VisFontLoad function.
Related Functions
VisFontEnum, VisFontLoad
VisFontGet
Syntax bOk = VisFontGet ( hFont, sFaceName, nPointSize, nFontEnhancement) Number: hFont
sFaceName String to contain the font name (Arial, Times New Roman, etc.)
FONT_EnhUnderline
FONT_EnhBold
FONT_EnhStrikeout
Return Boolean: TRUE if successful, or FALSE if an error occurs.
Related Functions
VisFontEnum, VisFontLoad
Example On SAM_Click
Set nIndex = SalListQuerySelection (hWndItem) If nIndex !=
LB_Err Call VisFontGet
(hFont, sFontName, nPointSize,
nFontFlags)
If nFontFlags & FONT_EnhBold
...
VisFontLoad
Syntax hFont = VisFontLoad ( sFontName, nFontSize, nFontEnhancement) String: sFontName
Number: nFontSize Number: nFontEnhancement
Return Number: The handle of the font if successful, NULL if an error occurs.
Related Functions
VisFontEnum, VisFontFree
Example On SAM_Create
Set hFont = VisFontLoad (' Arial', 10, FONT_EnhBold)
Description Retrieves a copyright string to display in applications that use the Vis Library.
Parameters No parameters.
Related Functions
VisGetVersion
VisGetKeyState
Syntax nState = VisGetKeyState ( nVirtualKey) Number:
nVirtualKey
Description Retrieves the state of a specified key. The state specifies whether the key is up, down, or toggled.
Parameters nVirtualKey Virtual key code to retrieve the state. See the Appendix for a complete list of
virtual key codes.
Return Number: The bit values indicating the state of the key specified. To test a bit value, use the bitwise AND
(&) operator.
Example On SAM_Click
Set nState = VisGetKeyState (VK_Control)
If nState & KS_Down
...
VisGetSystemMetrics
Syntax nValue = VisGetSystemMetrics( nIndex) Number:
nIndex
SM_XBorderSM_YMin
SM_YBorderSM_XMinTrack
SM_YCaptionSM_YMinTrack
SM_XCursorSM_XScreen
SM_YCursorSM_YScreen
SM_XDoubleClickSM_XHScroll
SM_YDoubleClickSM_YHScroll
SM_XDlgFrameSM_XVScroll
SM_YDlgFrameSM_YVScroll
SM_XFrameSM_XSize
SM_YFrameSM_YSize
SM_XFullScreenSM_XHThumb
SM_YFullScreenSM_YVThumb
SM_XIconSM_DBCSEnabled
SM_YIconSM_Debug
SM_XIconSpacingSM_MenuDropAlignment
SM_YIconSpacingSM_MousePresent
SM_KanjiWindowSM_PenWindows
SM_MenuSM_SwapButton SM_XMin
Example Actions
Set nScreenWidth = VisGetSystemMetrics (SM_XScreen)
VisGetVersion
Syntax sVisVersion = VisGetVersion ()
Parameters No parameters.
Example Actions
Set dfVersion = 'Version ' || VisGetVersion ()
VisGetWinFlags
Syntax nFlags = VisGetWinFlags ()
Parameters None.
Example Actions
Set nWinFlags = VisGetWinFlags ()
If nWinFlags & WF_CPU486
VisGetWinVersion
Syntax nWinVersion = VisGetWinVersion ()
Parameters No parameters.
Example Actions
Set nWinVersion = VisGetWinVersion ()
VisListAddValue
Syntax nIndex = VisListAddValue ( hWndList, sText, nValue) Window
Handle: hWndList String: sText Number: nValue
Description Adds an item to a sorted list box or combo box and associates the specified value with the item. The value
can be a record identifier for a database, a file offset, or any other integer value that the application can use
to uniquely identify the item. Use VisListInsertValue for unsorted list boxes or combo boxes.
Parameters hWndList Window handle of list box or combo box to add item to.
nValue Value to associate with the added item. May be a positive or negative
integer value.
Return Number: The index to the item added, or LB_Err if an error occurs.
Related Functions
VisListInsertValue
VisListArrayPopulate
Syntax nNumItems = VisListArrayPopulate ( hWndList, sText) Window
Handle: hWndList String: sText[*]
Description Populates a list box from a string array. Each item in the string is inserted as an item in the list box.
Return Number: The number of items added to the list box or combo box, or LB_Err if an error occurs.
Related Functions
VisListArrayPopulateValue
VisListArrayPopulateValue
Syntax nNumItems = VisListArrayPopulateValue ( hWndList, sText, nValues) Window Handle:
hWndList String: sText[*] Number: nValues[*]
Description Populates a list box from a string array and an array of values. Each item in the string is inserted as an item
in the list box. The number of items in the string array and the number of items in the value array must be
the same.
Related Functions
VisListArrayPopulate
VisListClearSelection
Syntax bOk = VisListClearSelection ( hWndList) Window
Handle: hWndList
Description Unselects all selected items in a list box or combo box. If the window handle is a multiple selection list box,
all selected items are unselected. If the window handle is a single selection list box or a combo box, the
currently selected item is unselected. Combo boxes do not allow multiple selections.
Parameters hWndList Handle to list box or combo box to clear selection from.
Related Functions
VisListDeleteSelected
Example Actions
Call VisListClearSelection (hWndItem)
VisListDeleteSelected
Syntax nNumDeleted = VisListDeleteSelected ( hWndList) Window
Handle: hWndList
Description Deletes all selected items from a list box or combo box. If the window handle is a multiple selection list box,
all selected items are deleted. If the window handle is a single selection list box or a combo box, the
currently selected item is deleted. Combo boxes do not allow multiple selections.
Parameters hWndList Window handle of list box or combo box to delete selected items.
Return Number: nNumDeleted is the number of items deleted, or negative if an error occurs.
Related Functions
VisListClearSelection
VisListFindString
Syntax nIndex = VisListFindString ( hWndList, nStartIndex, sText) Window Handle:
hWndList, Number: nStartIndex String:sText
Description Finds the first string that matches the specified string in a list box or combo box. The search requires an
exact match of all characters, but it is not case sensitive.
nStartIndex Specifies the index of the item before the first item to be searched.
Searching begins at nStartIndex + 1. If the search
reaches the bottom of the list, it continues at the top and back to the item
specified. To search from the beginning, specify -1.
Return Number: The index of the string if it is found, or negative if an error occurs.
Example Actions
Set nIndex = VisListFindString (lbSample, 0, 'Red')
VisListFindValue
Syntax nIndex = VisListFindValue ( hWndList, nStartIndex, nValue) Window Handle:
hWndList
Number: nStartIndex
Number:nValue
Description This function will locate a value associated with an item based on an index.
nStartIndex The index to begin searching; specify -1 to search from the top of the list.
Searching begins at nStartIndex + 1.
Return Number: The index containing the value specified, or LB_Err if the value cannot be found.
Example Actions
Set nIndex = SalListQuerySelection (hWndItem) If nIndex !=
LB_Err
Set nIndexFound = VisListFindValue (lbNames, nIndex,
100)
VisListGetDropdownState
Syntax bState = VisListGetDropdownState ( hWndList) Window
Handle: hWndList,
Description Determines whether the list box portion of a combo box is visible.
Example Actions
If VisListGetDropdownState (hWndItem)
...
VisListGetFocusIndex
Syntax nIndex = VisListGetFocusIndex ( hWndList) Window
Handle: hWndList
Description Gets the index of the item which has the focus rectangle or the last item to receive the focus frame in a
multiple-selection list box. This function will retrieve the selected item on a combo box.
Return Number: The index of the item that has the focus rectangle, if a multiple selection list box. If the function is
operating on a single-selection list box or combo box, the return value is the index of the item that is
selected, if any.
Related Functions
VisListSetFocusIndex
Example Actions
Set nIndex = VisListGetFocusIndex (hWndItem)
If nIndex != LB_Err
VisListGetVisibleRange
Syntax nNumVisible = VisListGetVisibleRange ( hWndList, nTop, nBottom) Window Handle:
hWndList Receive Number: nTop Receive Number: nBottom
Description Retrieves the indexes of both the first visible item and the last visible item in a list box. This function
will not operate on a combo box.
Return Number: The number of visible items, or negative if an error occurs or if hWndList is
a combo box.
VisListInsertValue
Syntax nIndex = VisListInsertValue ( hWndList, nIndex, sText, nValue) Window Handle:
hWndList Number: nIndex String: sText Number: nValue
Description Inserts an item into an unsorted list box or combo box and associates the specified value with the item. The
value can be a record identifier for a database, a file offset, or any other integer value that the application
can use to uniquely identify the item. Use VisListAddValue for sorted list boxes or combo boxes.
Parameters hWndList Window handle of list box or combo box to insert item into.
nIndex Position to insert item in list box (-1 to insert at the bottom).
nValue Value to associate with the inserted item. May be a positive or negative integer
value.
Return Number: The index to the item inserted, or LB_Err if an error occurs.
Related Functions
VisListAddValue
VisListIsMultiSelect
Syntax bOk = VisListIsMultiSelect ( hWndList) Window
Handle: hWndList
Returns Boolean: TRUE if multi selection is enabled for the list box, FALSE if not.
Example Actions
If VisListIsMultiSelect (hWndList)
...
VisListLoadOutline
Syntax nErrCode = VisListLoadOutline ( hWndList, sOutlineBlob) Window
Handle: hWndList String: sOutlineBlob
Description Loads an outline from a blob (binary large object) in memory. The blob must be created from a call to
VisListSaveOutline. The outline will be restored exactly as it was when the outline was saved, including
selected items and outline position in the list box or combo box.
Related Functions
VisListSaveOutline
Example On Sam_Click
Call VisListLoadOutline (twOutline, sOutline)
VisListLoadOutlineFile
Syntax nErrCode = VisListLoadOutlineFile ( hWndList, sOutlineFileName, hPicParentNormal,
hPicParentSelect, hPicChildNormal, hPicChildSelect) Window Handle: hWndList String:
sOutlineFileName Number: hPicParentNormal Number: hPicParentSelect Number:
hPicChildNormal Number: hPicChildSelect
Description Loads an outline from a tab indented ASCII file. The parent/child relationships are derived from the order
of the text lines and the indentation of the text in the file. Since the file contains no picture information,
handles to the pictures to use for the parent and lowest level children must be passed in.
hPicChildNormal Picture to use when lowest level child item is not selected. Call VisPicLoad to
create a picture handle.
Description Compresses and saves a list box or combo box outline into a blob (binary large object) in memory. The blob
data may then be inserted into a LONG VARCHAR column of a database.
Related Functions
VisListLoadOutline
Example On SAM_Destroy
If VisListSaveOutline (twOutline, sOutline)
Call SqlPrepare (hSql, 'INSERT INTO TABLE’ (out_id,
outline)values (:nOutID, :sOutline')
VisListScroll
Syntax nErrCode = VisListScroll ( hWndList, nIndex) Window
Handle: hWndList Number: nIndex
Description Scrolls an item into view. This function does not force the item to the top of a list box. The item may be
scrolled anywhere in the visible range. This function does not operate on combo boxes.
Example Actions
Call VisListScroll (hWndItem, 0)
VisListSetDropdownState
Syntax bOk = VisListSetDropDownState ( hWndList, bState) Window
Handle: hWndList Boolean: bState
Description Shows or hides the list box portion of a combo box. This function does not operated on list boxes.
Related Functions
VisListGetDropDownState
Example Actions
Call VisListSetDropDownState (hWndItem, TRUE)
VisListSetFocusIndex
Syntax nErrCode = VisListSetFocusIndex ( hWndList, nIndex) Window
Handle: hWndList Number: nIndex
Description Sets the focus rectangle to the item at the specified index in a multiple-selection list box. If the item is not
visible, it is scrolled into view. If hWndList is a single select list
box, no action is performed.
Related Functions
VisListGetFocusIndex
Example Actions
Call VisListSetFocusIndex (hWndItem, 5)
Description Sets the width by which a list box can be scrolled horizontally. The horizontal width is determined by the
string length of the longest item. If the width of the item specified is not longer that the current width, the
current width is not adjusted. The first call to
VisListSetScrollWidth displays a horizontal scroll bar in the list box. This function does not work on
combo boxes.
Parameters hWndList Window handle of list box to set the scroll width.
nIndex Item to base the scroll width on. If -1 all items are searched for the largest text
length.
Example Actions
Call VisListSetScrollWidth (lbText, -1)
VisMenuGetPopupHandle
Syntax hMenu = VisMenuGetPopupHandle ( hMenu, nPos) Number:
hMenu Number: nPos
Description Retrieves the menu handle of a pop-up menu. A pop-up menu appears below a top level menu option, or
to the side of another pop-up menu.
nPos Zero-based position in the specified menu of the pop-up menu. Menu
separators are included in the position count. It cannot be a negative value
indicating a menu ID added using
VisMenuInsert, which always returns a negative menu ID value.
Return Number: The menu handle of the menu specified, or NULL if the window has no menu.
Related Functions
VisMenuGetSystemHandle
hSubMenu = VisMenuGetPopupHandle
(hMenu, 2)
VisMenuGetSystemHandle
Syntax hMenu = VisMenuGetSystemHandle ( hWnd) Window
Handle: hWnd
Description Retrieves the system menu handle of a window. The system menu is located in the upper left corner of a
window.
Return Number: The system menu handle of window specified, or NULL if the window has no menu.
Related Functions
VisMenuGetPopupHandle
Example Variables
Number: hMenu
... Actions
VisMenuGetText
Syntax sMenuText = VisMenuGetText ( hWnd, hMenu, nPos) Window
Handle: hWnd Number: hMenu Number: nPos
Description Retrieves the text of a menu item. The text of any menu item, whether defined in Centura or inserted
via the Vis Library, may be returned.
nPos Zero-based position within the menu of the item. Menu positions include
separators. If negative, identifies a menu item added using VisMenuInsert, which
always returns a negative menu ID value.
Related Functions
VisMenuSetText
Example Variables
Number: hMenu
... Actions
VisMenuInsert
Syntax nMenuID = VisMenuInsert ( hWnd, hMenu, nPos, sMenuText, nFlags) Number: hWnd
Number: hMenu Number: nPos String: sMenuText Number: nFlags
Description Inserts a menu item into a menu. Menu items can be inserted into system, top-level or pop-up menus. Prior
to Centura 4.1, items could not be inserted into the middle of a Centura menu. They could only be inserted
at the end of a Centura menu or in the middle of items previously inserted with a
VisMenuInsert call.
Parameters hWnd Handle to window containing the menu. This window will be notified with a
VTM_MenuSelect message when the menu item is selected.
nPos Zero-based position within the menu of the item. Menu positions include
separators. Specify -1 to insert at the end of the menu.
sMenuText Text of item to insert. Specify \t to insert a tab in the text. A tab will separate
the menu text from the accelerator indicator. All text after the tab will be shown
along the right edge of the menu.
nFlags Menu flags. To combine bit values, use the bitwise OR (|) operator.
MF_Checked
MF_Disabled
MF_Separator
Returns Number: The ID value of the menu item inserted, or NULL if an error occurs. Menu IDs are always
negative. Each inserted item is assigned a unique ID.
Related Functions
VisMenuInsertFont, VisMenuInsertPicture
Example On SAM_Create
Set hMenu = VisMenuGetHandle (hWndForm) Set hMenu =
VisMenuGetPopupHandle (hMenu, 2) Call VisMenuInsert
(hWndForm, hMenu, -1, '', MF_Separator)
Set nMenuID = VisMenuInsert (hWndForm, hMenu, -1,
'Sample\tAlt-S', 0)
VisMenuInsertFont
Syntax nMenuID = VisMenuInsertFont ( hWnd, hMenu, nPos, hFont sMenuText) Number: hWnd
Number: hMenu Number: nPos Number: hFont String: sMenuText
Description Inserts a menu item into a menu and displays it in the specified font. Prior to Centura
4.1, items could not be inserted into the middle of a Centura menu. They could only be inserted at the end
of a Centura menu or in the middle of items previously inserted with a VisMenuInsert call.
Parameters hWnd Handle to window containing the menu. This window will be notified with a
VTM_MenuSelect message when the menu item is selected.
nPos Zero-based position within the menu of the item. Menu positions include
separators. Specify -1 to insert at the end of the menu.
hFont Handle to font to use for menu item display. Call VisFontLoad to create a font
handle.
sMenuText Text of item to insert. Specify \t to insert a tab in the text. A tab will separate
the menu text from the accelerator indicator. All
Returns Number: The ID value of the menu item inserted, or NULL if an error occurs. Menu IDs are always
negative. Each inserted item is assigned a unique ID.
Related Functions
VisMenuInsert, VisMenuInsertPicture
Example On SAM_Create
Set hFont = VisFontLoad ('Arial', 12, FONT_EnhBold) Set hMenu =
VisMenuGetHandle (hWndForm) Set hMenu =
VisMenuGetPopupHandle (hMenu, 2) Call VisMenuInsert
(hWndForm, hMenu, -1, '',
MF_Separator) Set nMenuID = VisMenuInsertFont
VisMenuInsertPicture
Syntax nMenuID = VisMenuInsertPicture ( hWnd, hMenu, nPos, hPicNormal, hPicSelect, sMenuText) Number:
hWnd Number: hMenu Number: nPos Number: hPicNormal Number: hPicSelect String: sMenuText
Description Inserts a menu item into a menu and displays the specified picture with it. Prior to Centura 4.1, items
could not be inserted into the middle of a Centura menu. They could only be inserted at the end of a
Centura menu or in the middle of items previously inserted with a
VisMenuInsert call.
Parameters hWnd Handle to window containing the menu. This window will be notified with a
VTM_MenuSelect message when the menu item is selected.
nPos Zero-based position within the menu of the item. Menu positions include
separators. Specify -1 to insert at the end of the menu.
hPicNormal Handle of picture to display in menu item when item is not selected. Call
VisPicLoad to create a picture handle.
sMenuText Text of item to insert. Specify \t to insert a tab in the text. A tab will separate the menu text
from the accelerator indicator. All text after the tab will be shown along the right edge of the menu.
Returns Number: The ID value of the menu item inserted, or NULL if an error occurs. Menu IDs are always
negative. Each inserted item is assigned a unique ID.
Related Functions
VisMenuInsert, VisMenuInsertFont
VisMenuIsChecked
Syntax bOk = VisMenuIsChecked ( hMenu, nPos) Number:
hMenu Number: nPos
Description Uses the Windows check state to test whether a menu item is checked.
VisMenuIsChecked works with either menu items inserted using the Vis Library or Centura menu items. It
must be called in the Checked When section of the Centura outline in order to properly display the check
status of a Centura menu item .
Parameters hMenu Menu handle of menu to test. This may be a pop-up or system menu. It cannot
be a top-level menu.
nPos Zero-based position within the menu of the item. Menu positions include
separators. If negative, identifies a menu item added using VisMenuInsert, which
always returns a negative menu ID value.
Related Functions
VisMenuIsEnabled, VisMenuUncheck
VisMenuIsEnabled
Syntax bOk = VisMenuIsEnabled ( hMenu, nPos) Number:
hMenu Number: nPos
Description Uses the Windows enable state to test whether a menu item is enabled.
VisMenuIsEnabled works with either menu items inserted using the Vis Library or Centura menu items. It
must be called in the Enabled When section of the Centura outline in order to properly display the enable
status of a Centura menu item .
nPos Zero-based position within the menu of the item. Menu positions include
separators. If negative, identifies a menu item added using VisMenuInsert, which
always returns a negative menu ID value.
Related Functions
VisMenuIsChecked
VisMenuSetFont
Syntax bOk = VisMenuSetFont ( hWnd, hMenu, nPos, hFont sMenuText) Number: hWnd
Number: hMenu Number: nPos Number: hFont String: sMenuText
Description Displays a menu item in the specified font. VisMenuSetFont operates on Centura
menus or menus inserted with the Vis Library.
nPos Zero-based position within the menu of the item. Menu positions include
separators. If negative, identifies a menu item added using VisMenuInsert,
which always returns a negative menu ID value.
hFont Handle to font to use for menu item display. Call VisFontLoad to create a font
handle.
sMenuText Text of item to insert. Specify \t to insert a tab in the text. A tab will separate
the menu text from the accelerator indicator. All text after the tab will be shown
along the right edge of the menu. If the menu text is a null string, the text is
unchanged.
Related Functions
VisMenuSetPicture, VisMenuSetText
Example On SAM_Create
Set hFont = VisFontLoad ('Arial', 12, FONT_EnhBold) Set hMenu =
VisMenuGetHandle (hWndForm) Set hMenu =
VisMenuGetPopupHandle (hMenu, 2) Set nMenuID = VisMenuSetFont
(hWndForm, hMenu, -1,
hFont, 'Sample\tAlt-S')
nPos Zero-based position within the menu of the item. Menu positions include
separators. If negative, identifies a menu item added using VisMenuInsert, which
always returns a negative menu ID value.
hPicNormal Handle of picture to display in menu item when item is not selected. Call
VisPicLoad to create a picture handle.
sMenuText Text of item to insert. Specify \t to insert a tab in the text. A tab will separate
the menu text from the accelerator indicator. All text after the tab will be shown
along the right edge of the menu. If the menu text is a null string, only the
picture will be shown. If a picture and text are specified, the text is always
shown to the right of the picture.
Related Functions
VisMenuSetFont, VisMenuSetText
Example On SAM_Create
Set hPic = VisPicLoad (PIC_LoadResource |
PIC_FormatBitmap, 'Vis.dll', 'bkopen') Set hMenu =
VisMenuGetHandle (hWndForm) Set hMenu =
VisMenuGetPopupHandle (hMenu, 2) Set nMenuID = VisMenuSetPicture
(hWndForm, hMenu, -1,
hPic, 'Sample\tAlt-S')
VisMenuSetText
Syntax bOk = VisMenuSetText ( hWnd, hMenu, nPos, sText) Window
Handle: hWnd Number: hMenu Number: nPos String: sText
Description Changes the text of a menu item. VisMenuSetText operates on Centura menus or
menus inserted with the Vis Library.
hMenu Handle of menu that contains the menu item to reset text for.
nPos Zero-based position within the menu of the item. Menu positions include
separators. If negative, identifies a menu item added using VisMenuInsert,
which always returns a negative menu ID value.
sText New text to use for the specified menu item. Specify \t to insert a tab in the
text. A tab will separate the menu text from the accelerator indicator. All text
after the tab will be shown along the right edge of the menu.
Related Functions
VisMenuSetFont, VisMenuSetPicture
Description Unchecks a menu item. VisMenuUncheck is intended for menu items that have been
inserted using the Vis Library. It also works for Centura menu items but will remove the check mark only
if VisMenuIsChecked is called in the When Checked section of
the Centura outline. This is because VisMenuIsChecked returns the Windows state
of the menu item and VisMenuUncheck will set the Windows state.
nPos Zero-based position within the menu of the item. Menu positions include
separators. If negative, identifies a menu item added using VisMenuInsert, which
always returns a negative menu ID value.
Related Functions
VisMenuIsChecked
VisMessageBox
Syntax nReturn = VisMessageBox ( sMsgText, sCaption, hPicIcon, hBtnHandles, nNumButtons)
String: sText String: sCaption Number: hPicIcon Number: hBtnHandles[*] Number:
nNumButtons
Description Displays a message box with user defined buttons and a user defined icon.
hPicIcon Icon to display in message box. This must be an icon; it cannot be a bitmap.
Call VisPicLoad to create a picture handle. May
be one of the following constants:
MBF_IconAsterisk
MBF_IconHand
MBF_IconQuestion
MBF_IconExclamation
hBtnHandles Array of button handles to display. These handles are obtained from a call to VisMessageLoadButton.
The button handle may be OR'ed with MBF_DefButton to set the default focus
button.
Returns Number: The return value indicating which button is selected. The return value is assigned using
VisMessageLoadButton.
Related Functions
VisMessageFreeButton
Syntax bOk = VisMessageFreeButton ( hBtn) Number:
hBtn
Related Functions
VisMessageLoadButton
nReturn Return value if button is clicked in the message box. This value is returned from VisMessageBox
.
Related Functions
VisMessageFreeButton
Example On SAM_AppStartup
Set hBtnOk = VisMessageLoadButton ('Ok', ID_OK) Set hBtnHelp
= VisMessageLoadButton ('&Help', ID_Help)
VisMessageSetBkgdColor
Syntax bOk = VisMessageSetBkgdColor ( nColor) Number:
nColor
Description Sets the background color for a VisMessageBox dialog box. All subsequent calls to
VisMessageBox will display a dialog with the color indicated.
Related Functions
VisMessageBox
VisNumberBitClear
Syntax nResult = VisNumberBitClear ( nValue, nBitMask) Receive
Number: nValue Number: nBitMask
Parameters nValue Number value to clear bits from. The function replaces this number with
the result.
Return Number: The resulting value after mask bits are cleared. This value is also placed in
nValue.
Related Functions
VisNumberBitSet
Example Constants
Number: BIT_Flag1 = 0x0001
Number: BIT_Flag2 = 0x0004
... Actions
VisNumberBitSet
Syntax nResult = VisNumberBitSet ( nValue, nBitMask) Receive
Number: nValue Number: nBitMask
Parameters nValue Number value to set bits for. The function replaces this number with the result.
Return Number: The resulting value after mask bits are set. This value is also placed in
nValue.
Related Functions
VisNumberBitClear
Example Constants
Number: BIT_Flag1 = 0x0001
Number: BIT_Flag2 = 0x0004
... Actions
Related Functions
VisStrChoose
Example Actions
Set nError = VisNumberChoose ( nWnd = hWndNULL, TRUE, FALSE)
VisNumberHighByte
Syntax nNumber = VisNumberHighByte( nNumber) Number:
nNumber
Description Converts the specified number to a WORD and returns the high order 8 bits of the WORD.
Related Functions
VisNumberLowByte
Example Actions
Set nValue = 0xC8D4 Set
nHiByte = VisNumberHighByte (nValue)
!nHiByte = OxC8.
VisNumberLowByte
Syntax nNumber = VisNumberLowByte( nNumber) Number:
nNumber
Description Converts the specified number to a WORD and returns the low order 8 bits of the WORD.
Related Functions
VisNumberHighByte
Example Actions
Set nValue = 0xC8D4 Set
nLowByte = VisNumberLowByte ( nValue)
!nLowByte = OxD4.
VisNumberMakeLong
Syntax nLong = VisNumberMakeLong( nLow, nHigh) Number:
nLow Number: nHigh
Description Creates a double word value (DWORD) from two word values.
Example Actions
Set nLow = 0x0101 Set nHigh = 0xABCD Set nLong = VisNumberMakeLong
VisPicFree
Syntax nErrCode = VisPicFree ( hPic)
Number: hPic
Related Functions
VisPicLoad
VisPicLoad
Syntax hPic = VisPicLoad ( nFormatFlags, sString1, sString2) Number:
nFormatFlags String: sString1 String: sString2
Description Loads a picture into memory. A picture is either a bitmap or an icon and may be obtained from a file, a
resource-only DLL, a Centura string, or a Centura resource. The maximum size of a picture is 65,633
bytes.
Parameters nFormatFlags Flags indicating the type and format of the picture. One format flag and one load
flag must be OR'ed together. PIC_FormatBitmap PIC_FormatIcon PIC_LoadFile
PIC_LoadResource PIC_SWinRes PIC_SWinStr
PIC_LoadFile
PIC_LoadResource
PIC_SwinRes
PIC_SwinStra
sString2 If PIC_LoadResource is specified, contains the name of the picture
resource to load. Not used for any other load flags.
Return Number: The handle of the specified picture if successful, or NULL if an error occurs.
Related Functions
VisPicFree
VisSendMsgString
Syntax nResult = VisSendMsgString ( hWnd, nMessage, wParam, sString) Number: hWnd
Number nMessage Number: wParam String: sString
Description Sends a message and passes a string in lParam. VisSendMsgString should be used to
send Windows SDK messages to a window where a string must be passed. The string is passed as a pointer
(LPSTR).
Related Functions
VisNumberChoose
VisStrExpand
Syntax sString = VisStrExpand ( sTemplate, hAry) String:
sTemplate Number | String: hAry[*]
Description Expands a template string by inserting one or more array elements. A template string consists of ordinary
characters, and one or more expand specifications. An expand specification has the following format:
%[ , ]type
Expand specifications always begin with a percent sign and are read from left to right. When the first expand
specification is encountered, the value of the first array element is converted and inserted into the return
string.
The second expand specification causes the second element to be inserted, and so on. If there are more array
elements than expand specifications, the extra elements are ignored. Valid types are s, n, and u.
If braces {} are specified in the template, the text between the braces is repeated. If a comma is specified
between the percent sign and the type character, each repeat string is comma delimited before the repeat
string, except the first element.
Related Functions
VisStrSubstitute
Example Variables
String: sReplaceAry[*]
Actions
Set sReplaceAry[1] = 'myfile' Call
SalMessageBox ( VisStrExpand ('Error:%s File:%s',
sReplaceAry), 'Title', MB_Ok)
VisStrFind
Syntax sString = VisStrFind ( hStrTable, sIdentifier) Number:
hStrTable String: sIdentifier
Description Locates a string within a string table. The string table must be loaded into memory using VisStrLoadTable.
sIdentifier Identifier used to located the string within the string table. Identifiers are
enclosed within braces {} in the string table.
Returns String: The located string, or null string if not found. The entire string after the trailing brace of the
identifier is returned.
Related Functions
VisStrFreeTable, VisStrLoadTable
Example On SAM_AppStartup
Set hStrTable = VisStrLoadTable ('MyStrings.txt') Set sString
= VisStrFind (hStrTable, 'dbError.MyString')
Related Functions
VisStrFind, VisStrLoadTable
VisStrLeftTrim
Syntax sString = VisStrLeftTrim ( sSource) String:
sSource
Related Functions
VisStrRightTrim, VisStrTrim
VisStrLoadTable
Syntax hStrTable = VisStrLoadTable ( sFileName) String:
sFileName
Description Loads a string table from disk into memory. The maximum size of a string table is
65,533 bytes.
Parameters sFileName File name of string table to load. If no path is specified, the current
drive/directory is searched.
Returns String: The handle of the string table if successful, or negative if an error occurs.
Related Functions
VisStrFind, VisStrFreeTable
VisStrPad
Syntax sString = VisStrPad ( sSource, nSize) String:
sSource Number: nSize
Description Pads a string with trailing blanks and returns the result. If the length of the source string is greater than
the size, the source string is truncated.
Return String: The padded string. The return string is always the size specified.
Related Functions
VisStrTrim
VisStrProper
Syntax sString = VisStrProper ( sSource) String:
sSource
Description Converts a string to mixed case. If the string is all lowercase, the first letter of each word is capitalized. If the
string is all uppercase, the first letter of each word is left capitalized while the remaining letters are made
lowercase. Before the source string is converted, the following delimiters are removed:
~!@#$%^&*()_+-=|\[]{}:";'?,./. After the conversion, the delimiters are reinserted. The first letter following Mc,
Mac, or O' are also capitalized.
VisStrLeftTrim, VisStrTrim
VisStrScanReverse
Syntax nOffset = VisStrScanReverse ( sSource, nPos, sSearchFor) String:
sSource Number: nPos String: sSearchFor
Description Scans a string for a specified sub-string from the last character to the first. Case is ignored when
performing the search.
nPos Position to begin the search, -1 to begin searching from the last character.
nOffset = 0
...
VisStrSubstitute
Syntax sString = VisStrSubstitute ( sSource, sSearch, sReplace) String: sSource
String: sSearch String: sReplace
VisStrTrim
Syntax sString = VisStrTrim ( sSource) String:
sSource
Description Trims leading and trailing blanks from a string. It does not adjust embedded brackets.
Related Functions
VisStrLeftTrim, VisStrRightTrim
! sTarget = 'ABC'
VisTblAllRows
Syntax bOk = VisTblAllRows ( hWndTable, nFlagsOn, nFlagsOff) Handle:
hWndTable Number: nFlagsOn Number: nFlagsOff
Description Determines whether any rows in the specified table window match certain flags. If multiple flags are
specified in the nFlagsOn parameter, all specified flags must match the row flags (an AND operation is
used to test the flags).
nFlagsOn Bit flags to test, all bits must exist in the row flag for a valid match.
nFlagsOff Bit flags that the row cannot have. The row cannot have any of the flags
specified.
VisTblAutoSizeColumn
Syntax bOk = VisTblAutoSizeColumn ( hWndTable, hWndColumn) Handle:
hWndTable Handle: hWndColumn
Description Performs a best fit on the display contents of a specific column. A best fit will resize a column based on the
current contents of the displayed columns. The column heading and split window contents are included in
calculating the width.
hWndColumn Column window handle to auto size. Specify hWndNULL to size all
columns.
VisTblClearColumnSelection
Syntax bOk = VisTblClearColumnSelection ( hWndTable) Handle:
hWndTable
VisTblFindDateTime
Syntax nRow = VisTblFindDateTime ( hWndTable, nStartRow, hWndColumn, dtDateTime) Handle: hWndTable
Number: nStartRow Number: hWndColumn Date/Time: dtDateTime
Description Locates a date/time value within a column. Searching ends when the last row in the table is checked. A
SAM_FetchRow message is sent for all rows that have not yet been fetched into the cache.
hWndColumn Handle of column to search or hWndNULL to search all date/ time columns.
Related Functions
VisTblFindNumber, VisTblFindString
VisTblFindNumber
Syntax nRow = VisTblFindNumber ( hWndTable, nStartRow, hWndColumn, nNumber) Handle: hWndTable
Number: nStartRow Number: hWndColumn Number: nNumber
Description Locates a number value within a column. Searching ends when the last row in the table is checked. A
SAM_FetchRow message is sent for all rows that have not yet been fetched into the cache.
Related Functions
VisTblFindDateTime, VisTblFindString
VisTblFindString
Syntax nRow = VisTblFindString ( hWndTable, nStartRow, hWndColumn, sString) Handle: hWndTable
Number: nStartRow Number: hWndColumn String: sString
Description Locates a string value within a column. The string must match exactly and case is ignored. Searching ends
when the last row in the table is checked. A SAM_FetchRow message is sent for all rows that have not yet
been fetched into the cache. Case is disregarded in the search. You can use pattern matching characters.
The percent character (%) matches any set of characters. The underscore character ( _ ) matches any
single character.
Related Functions
VisTblFindDateTime, VisTblFindNumber
VisTblGetCell
Syntax sText = VisTblGetCell ( hWndTable, nRow, hWndColumn) Number: nRow
Handle: hWndColumn
Description Retrieves the contents of a cell in a table window. The row specified will be set to the context row.
Related Functions
VisTblGetColumnTitle
VisTblGetColumnTitle
Syntax sTitle = VisTblGetColumnTitle ( hWndColumn) Handle:
hWndColumn
Description Retrieves the contents of a column heading. The row specified will be set to the context row.
Related Functions
VisTblGetCell
Description Sets the text color for an entire row of a table window.
Related Functions
VisTblSetRowPicture, VisTblGetColumnTitle
VisTblSetRowPicture
Syntax bOk = VisTblSetRowPicture ( hWndTable, nRowFlag, hPic) Handle:
hWndTable Number: nRowFlag Number: hPic
Description Sets the picture for a bit flag of a table window. When any row contains the bit flag specified, the picture
will be drawn in the row header portion of the table window. Centura normally displays pictures for the
ROW_New, ROW_Edited, and ROW_MarkDeletedFlags. The Centura pictures will no longer be displayed
after the first call to VisTblSetRowPicture. The picture will simply be inverted when the row is selected. A
second picture cannot be displayed when the row is selected.
nRowFlag Row flag to trigger the display of the picture specified. Pictures may be set for
any of the following row flags: ROW_New ROW_Edited ROW_Markdeleted
ROW_UserFlag1 ROW_UserFlag2 ROW_UserFlag3 ROW_UserFlag4
ROW_UserFlag5
hPic Picture to display in the row header when the row contains the specified row
flag. This must be a bitmap; it cannot be an icon. Call VisPicLoad to create a
picture handle.
Related Functions
VisTblSetRowColor
Example On SAM_Create
Set hPic = VisPicLoad (PIC_Load Resource |
PIC_FormatBitmap, 'Vis.dll', VISPIC_CheckBlack) Call VisTblSetRowPicture
(twOrders, ROW_New, hPic)
VisWaitCursor
Syntax bOk = VisWaitCursor ( nFlags) Number:
nFlags
Description Turns hourglass cursor on or off. Differs from SalWaitCursor in the following ways:
1. Disables the current application when the hourglass is turned on and enables the application when the
hourglass is turned off.
3. Keeps a reference count each time the hourglass is turned on. Turns the hourglass off only when the
reference count is equal to zero. This allows VisWaitCursor to be embedded in low-level functions.
Parameters nFlags TRUE to display the cursor as an hourglass and FALSE to display as an
arrow. TRUE FALSE WAIT_SysModalOn WAIT_SysModalOff
WAIT_TempOn WAIT_TempOff
Description Clears the field edit flags for each data field or multi-line text field of a parent window. To prevent
clearing an edit flag for an individual window, set the WF_NoClearEditFlag flag with a call to
VisWinSetFlags.
Parameters hWndParent Window handle of parent window to clear all edit flags of.
Related Functions
VisWinClearAllFields
VisWinClearAllFields
Syntax nNumCleared = VisWinClearAllFields ( hWndParent) Window
Handle: hWndParent
Description Clears all child fields of a parent window. Data fields, multi-line text, list boxes, combo boxes, check
boxes, radio buttons, and child table windows are cleared. To prevent clearing a window, set the
WF_NoClear flag with a call to VisWinSetFlags.
Parameters hWndParent Window handle of parent window to clear all child fields of.
Related Functions
VisWinClearAllEditFlags
(hWndForm)
VisWinEnumProps
Syntax nNumItems = VisWinEnumProps ( hWnd, sPropStrings, sValues) Window Handle:
hWnd String: sPropStrings[*] String: sValues[*]
Description Enumerates the property list for a specified window. A property list can be used to define
application-specific attributes for a window. Use property lists sparingly as each string takes up system
resource space.
Parameters hWnd Window handle of window to get the property list of.
Return Number: The number of property list entries returned, or -1 if window handle is invalid.
Related Functions
Example Variables
String: sPropStrings[*]
Number: nPropValues[*]
... Actions
VisWinFreeAccelerator
Syntax bOk = VisWinFreeAccelerator ( hAcc) Handle:
hAcc
Description Clears an accelerator for a window, along with all memory associated with the accelerator.
Related Functions
VisWinGetProp
VisWinGetFlags
Syntax nWinFlags = VisWinGetFlags ( hWnd) Handle:
hWnd
Returns Number: The window flags of window specified. To test a bit flag, use the bitwise AND (&) operator.
Options are: WF_Required WF_NoClear WF_NoClearEditFlag WF_EnableWhenNotNull WF_FitPath
WF_DisplayOnly
Related Functions
VisWinSetFlags
Example Actions
Set nFlags = VisWinGetFlags (hWndForm)
VisWinGetHandle
Syntax hWnd = VisWinGetHandle ( hWndDialog, sContext, nWindowType) Window Handle:
hWndDialog String: sContext Number: nWindowType
Description Obtains a window handle based on the window type and a context string. Under Centura, the
bStaticsAsWindows variable must be set to TRUE in order for Centura to create actual windows.
Otherwise, Centura paints the background text and the window handle does not exist.
Parameters hWndDialog Window handle of dialog box containing window handles to search for.
TYPE_BkgdText
TYPE_GroupBox
Return Window Handle: The window handle if successful, or NULL if window not found.
Example Actions
Set hWnd = VisWinGetHandle (hWndForm, 'Sample:',
TYPE_BkgdText)
VisWinGetProp
Syntax nValue = VisWinGetProp ( hWnd, sPropString) Window
Handle: hWnd String: sPropString
Description Retrieves a value from the property list of a specified window. A property list can be used to define
application-specific attributes for a window. Use property lists sparingly as each string takes up system
resource space.
Parameters hWnd Window handle of window to get the property list for.
Return Number: The property value of the window. Zero may indicate no property exists, or the window has a
property with the value of zero.
Related Functions
VisWinRemoveProp, VisWinSetProp
VisWinGetStyle
Syntax nStyle = VisWinGetStyle ( hWnd) Window
Handle: hWnd
Description Retrieves the Windows style bits for a specified window. These style bits are documented in the
Windows SDK documentation.
Return Number: The style bits of the window specified, or -1 if window is invalid.
VisWinSetStyle
Example Variables
Number: nStyle
... Actions
VisWinGetText
Syntax sString = VisWinGetText ( hWnd) Window
Handle: hWnd
Description Obtains the text of a window. Window text is the title of a form window, dialog box, table window, radio
button, check box, background text or push button. For a data field, multi-line text field or table window
column, window text is the current contents. Note: Use VisTblGetColumnTitle to get the title of a table
window column.
Returns String: The window text, if successful, or null string if error occurs.
VisWinIsChild
Syntax bOk = VisWinIsChild ( hWndParent, hWndChild) Window
Handle: hWndParent Window Handle: hWndChild
Description Tests whether a specified window is a child or direct descendant of a parent window.
Related Functions
VisWinIsWindow
Example Actions
If VisWinIsChild (hWndForm, pbOk)
...
VisWinIsMaximized
Syntax bOk = VisWinIsMaximized ( hWnd) Window
Handle: hWnd
Related Functions
VisWinIsMinimized, VisWinIsRestored
Example Actions
If VisWinIsMaximized (hWndForm)
VisWinIsMinimized
Syntax bOk = VisWinIsMinimized ( hWnd) Window
Handle: hWnd
Related Functions
VisWinIsMaximized, VisWinIsRestored
Example Actions
If VisWinIsMinimized (hWndForm)
Parameters hWndParent Handle of parent window to test. If any child window is required and
contains a null value,
VisWinIsRequiredFieldNull returns TRUE.
Returns Window Handle: Handle of first required field that contains no value, or null if all required fields are
non-null.
VisWinIsRestored
Syntax bOk = VisWinIsRestored ( hWnd) Window
Handle: hWnd
Vi sWinIsMaximized, VisWinIsMinimized
Example Actions
If VisWinIsRestored (hWndForm)
VisWinIsWindow
Syntax bOk = VisWinIsWindow ( hWnd) Window
Handle: hWnd
Related Functions
VisWinIsChild
Example Actions
If VisWinIsWindow ( hWndForm)
VisWinLoadAccelerator
Syntax hAcc = VisWinLoadAccelerator ( hWndNotify, nMsg, nKeyDownState, nVirtualKey, nValue)
Handle: hWndNotify
Number: nMsg
Number: nKeyDownState
Number: nVirtualKey Number:
nValue
Description Sets an accelerator keystroke for a window. If the accelerator is pressed, the specified window is notified
with the specified message. The lParam of the message sent will contain the accelerator handle.
nMsg Message to send to the window specified when the accelerator is pressed.
nKeyDownState Flag indicating the keys held down in combination with the virtual key.
Options are: KDS_None KDS_Shift
KDS_Ctrl
KDS_ShiftCtrl
KDS_Alt KDS_AltCtrl
KDS_AltShift
KDS_ShiftAltCtrl
nVirtualKey Virtual key to act as accelerator. See the Appendix for a complete
listing of virtual key codes.
nValue Any application defined value that will be passed in lParam of the message sent
when the accelerator is pressed. This can be used to pass menu ID values when
menu accelerators are used.
Related Functions
VisWinFreeAccelerator
VisWinMove
Syntax bOk = VisWinMove ( hWnd, nLeft, nTop, nWidth, nHeight) Handle: hWnd
Number: nLeft Number: nTop Number: nWidth Number: nHeight
Description Moves and resizes a window, based on pixel coordinates. If the window is a form window or table window,
the coordinates are relative to the screen. If the window is a child window, the coordinates are relative to
the parent window's client area.
nLeft Identifies the new position of the left side of the window.
Example Actions
Call VisWinMove ( hWnd, 10, 25, 425, 200)
VisWinRemoveProp
Syntax bOk = VisWinRemoveProp ( hWnd, sPropString) Window
Handle: hWnd String: sPropString
Description Removes a property list entry for a specified window. A property list can be used to define
application-specific attributes for a window. Use property lists sparingly as each string takes up system
resource space.
Parameters hWnd Window handle of window to remove the property list from.
Return Boolean: TRUE is entry was removed, FALSE if window handle invalid or property does not exist.
Related Functions
VisWinGetProp, VisWinSetProp
VisWinSetFlags
Syntax bOk = VisWinSetFlags ( hWnd, nWinFlags, bState) Handle:
hWnd Number: nWinFlags Boolean: bState
Related Functions
VisWinGetFlags
Example On SAM_Create
Call VisWinSetFlags (hWndItem, SWF_DisplayOnly, TRUE)
VisWinSetMeter
Syntax nErrCode = VisWinSetMeter ( hWnd, nPercent) Window
Handle: hWnd Number: nPercent
Description Displays a completion meter within a Centura data field. The complete portion is displayed in the
current text color and the incomplete portion is displayed in the current background color.
Parameters hWnd Window handle of a data field to display the completion meter in. This must be
the window handle of a data field.
Example Actions
Call VisWinSetMeter (dbMeter, 0)
VisWinSetProp
Syntax bOk = VisWinSetProp ( hWnd, sPropString, nValue) Window
Handle: hWnd String: sPropString Number: nValue
Description Adds a new property list entry or changes an existing property list entry for a specified window. A property
list can be used to define application-specific attributes for a window. Use property lists sparingly as each
string takes up system resource space.
Parameters hWnd Window handle of window to set the property list for.
Return Boolean: TRUE if entry was added or changed, FALSE if window handle invalid.
Related Functions
VisWinGetProp, VisWinRemoveProp
VisWinSetStyle
Syntax bOk = VisWinSetStyle ( hWnd, nStyle, bState) Window
Handle: hWnd Number: nStyle Boolean: bState
Description Adds a window style to a window. It does not set the style to the style bits passed in, rather it adds or
removes the style bits to the current style of the window.
nStyle Style bits to set or clear. The style bits are documented in the Windows SDK
documentation.
bState TRUE to turn the style bits on or FALSE to turn style bits off.
Return Boolean: TRUE if the function succeeded, FALSE if the function failed.
Related Functions
VisWinGetStyle
Example Actions
Call VisWinSetStyle (hWndItem, ES_AUTOHSCROLL)
Description Changes the tab order of a control. If hWndInsertAfter is NULL, the window is
removed from the tab order.
(hWndItem, NULL)
VisWinShow
Syntax bOk = VisWinShow ( hWnd, nShowFlag) Window
Handle: hWnd Number: nShowFlag
Return Boolean: TRUE if window previously was visible, FALSE if previously hidden.
Example Actions
Call VisWinShow ( hWndForm, SHOW_Maximized)
E P
edit functions 1-26 picture functions 1-42 print
functions 1-43
F
file management functions 1-27 S
format and validation functions 1-29 SalAbort 2-2 SalAppDisable 2-2
functions array SalAppEnable 2-3 SalAppFind 2-3
1-17 SalArrayAvg 2-4 SalArrayDimCount
data type conversion 1-19 2-4 SalArrayGetLowerBound 2-5
date 1-20 DDE 1-21 SalArrayGetUpperBound 2-5
debugging 1-22 SalArrayIsEmpty 2-6 SalArrayMax
dialog box 1-23 drag 2-7 SalArrayMin 2-7
drop 1-25 edit 1-26 SalArraySetUpperBound
2-309
2-318
VisWinGetFlags 2-319 VisWinGetHandle
2-319 VisWinGetProp 2-320
VisWinGetStyle 2-320 VisWinGetText
2-321 VisWinIsChild 2-321
VisWinIsMaximized 2-322
VisWinIsMinimized 2-322
VisWinIsRequiredFieldNull 2-323
VisWinIsRestored 2-323 VisWinIsWindow
2-324 VisWinLoadAccelerator 2-324
VisWinMove 2-325 VisWinRemoveProp
2-326 VisWinSetFlags 2-326
VisWinSetMeter 2-327 VisWinSetProp
2-327 VisWinSetStyle 2-328
VisWinSetTabOrder 2-329 VisWinShow 2-329
W
window management functions 1-51