John Barrs: Superbase Tips and Codelets

 

Below is a selection of Superbase Tips and code examples.

Links to main website areas

Home

Software 'Home'

About Me

Theology


Links to other Software  pages


Contracts

The items are grouped: The groups concerned are FIELD, FILE, FORM, PROGRAM  and SYSTEM. Of course there are somewhat arbitrary divisions as anything to do with forms might well involve fields and most  of them are programs; but the groupings do involve items which deal with similar areas of programming. Within a group the items are sorted alphabetically by the name I gave them when they were created.

If you wish to learn more about any item, then click on its name and you will be taken to a fuller description of the item. In this second list which is in the same order, group by name, some items appear with program names and some without - the distinction I am making here is between  seeing  a name 'abc.sbp' or a name 'abc'.

If it is a named program - 'abc.sbp' then that is also a link to enable you to download the program concerned. (All programs are saved as text). To the right of the program name is a fuller description. Most programs are coding for an idea and if they have a SUB main() that is present merely to demonstrate the way things work and may refer to files local to my system - in other words it is a demonstration of the usage of the code. However, some programs are complete processes and will have a SUB main() to run the code.

If it is a name - 'abc' then all the details are in the box to the right of the name and there is nothing more to download.

 

Warning:

This code and the ideas involved and demonstrated are offered on an 'as-is' basis. You use them entirely at your own risk. I am not responsible for any loss of programs, data, or damage to any software or hardware that might be involved. Formally: Neither I, my family, any servants or agents bear any responsibility for anything that might happen of any of these ideas are used by anyone else. These ideas are provided to give you ideas as to how to do things and not as finished or completed applications. (These I can produce for you if you wish - email me  for a quotation) If you would like to discuss any ideas or ask for a solution for a particular problem then again email me, discuss - I am quite happy to help out but am limited in both health and time.

 

top

Here is the Table of contents sorted alphabetically by and within group :

click on name for more details

 

 

 

FIELD:

DatBits

Various Date bits and pieces - note they often call each other so should be

 

FUTIL6

Generalised = remove leading spaces of all text field in a file

 

ZeroDate

Need to clear a date field? - send it 0

 

 

 

FILE:

chekfile

Checks file integrity by running up and down the file using its indexes

 

copylfn

This function will copy longfilenames

 

counter

2 functions to deal with multilined fields

 

FLDSIZE

To find out how big TXT and EXT (VTX VEX) fields in a used file actually are

 

FUTIL1

Checks through a file and resizes fields

 

FUTIL2

Test for commas in all fields

 

FUTIL3

Reorganizes the fields in a file to remove forward referenced calculations

 

FUTIL4

Various index functions

 

Futil5

Two procs to a) list Sbd files to windows,b) allow edit of sbd files

 

FUTIL89

Copy Unique resords from 1 file to another using a IXU

 

FUTILRAL

Reorganize all files in a directory

 

KSELECT

Modified Key Select to allow Change of File and Index

 

KSELECT1

Modified Key Select to allow Change of File and Index

 

OUTJOIN

Demo to play outerjoin game

 

QREP

How to stop report issuing a blank line

 

sbfsizes

Function to return size in bytes of a given sbf file

 

SET

A filter counter or two

 

 

 

FORM:

ANZAC

A 'transparent' field simulation by using labels (so that data can appear over

 

CASCDEL

Cascade delete code for 1 and 2 detblocks

 

DEMDBLK2

to add an OnGotFocus Procedure to all fields in a detailblock

 

DEMDBSRT

to demo changing sortfield on detail blocks

 

FRMWHERE

Set a filter on all files in a form

 

TABF

TabForms - demo of form to look like a multipage TABbed Form

 

utilfrm1

Analyse forms or reports for details - Written John Barrs Superbase Developers

 

utilfrm2

Analyse forms or reports for details - Written John Barrs Superbase Developers

 

UtilFrmc

sets Enabled to value toggle%% in detail block dbname$ for command buttons

 

 

 

PROGRAM:

CLOSITE

To Close all Open Programs

 

DDEDEMO

Two Programs DDEDEMA as Server,DDEDEMB to launch

 

filutil9

To DDE to hidden copySB to load and save programs as text programs

 

OUPICKD

Set output -- window,printer,diskfile

 

progut_1

Check what state (text, tokenised, or protected) all programs in a directory

 

TIP3.6i

SUPERBASE 3.6i TIP: PRINT CURRENT USING ... ASK

 

WCASE_0

Function to simulate WCASE$

 

 

 

SYSTEM:

Filer_v3

This is v3 version of filer (file finder) and has an internal directory changer

 

futil7

Display File Properties

 

futil93

to size a directory structure

 

futil94

Duplicate a directory structure in TEMP

 

GETDRIVE

returns Drivetype for input drive letter

 

LOCKTYPE

Gets Lock type (LAN Dist, Singele) of current SB (v3)

 

sb30ini

read Sb30 ini file and returns value associated with p$

 

SRCHMSK

Find a string in a directory

 

WINDIR

Get WinDir

top 

datbits.sbp

Program can be loaded by clicking on its name
Various Date bits and pieces - note they often call each other so should be included as a whole

top

futil6.sbp

Program can be loaded by clicking on its name
Generalised = remove leading spaces of all text field in a file

top

ZeroDate       

Need to clear a date field? - send it 0

top 

chekfile.sbp

Program can be loaded by clicking on its name
Checks file integrity by running up and down the file using its indexes
' using SELECT; TO APPEND
'
' Input parameters
' f$ - file to check
' (can be pathed, but if not, must be in current directory)
' outf$ - output text file to place results
' (have to know this because errors can close serial files)
' repair%% - if repair and recheck
' - 0 - do not repair
' - 1 - attempt repair
' ******************************************************************************************
' *********** CAVEAT ********
' *********** if repair option is taken, prior backup of data must have been taken ********
' *********** files are deleted and this author takes no responsibility for errors ********
' *********** CAVEAT ********
' ******************************************************************************************
' depending on the error and where it is, repair will be
' either an index remove and recreate
' or a reorganize and rename
' file ANSWER is used as a temporary file
'
' Note, whatever caused the failure is rechecked once only, so
' it is possible to have a very dirty file which ultimately reports OK
'
' Return Value - 0 if OK
' - ERRNO if any error
' - any negative number means Fail
'
' Calls CF_1a%% to actually run the reports
' Calls CF_REORG%% to do reorganize if necessary
'

top 

copylfn.sbp

Program can be loaded by clicking on its name
This function will copy longfilenames

Use

a%%=CopyFile%%(SourceFile$,DestFile$,Overwrite%%)

overwrite%%, 0 - no Overwrite, 1 allow Overwrite

Returns 0 if failed -1 if success

top 

counter.sbp

Program can be loaded by clicking on its name
2 functions to deal with multilined fields
a) Function Counter%
Function to count lines required to output text
' Inputs
' fd$ contains the field-name or variable name
' eg. fd$="Description.FILE" or fd$="x$"
' l%% is length of output-width characters required
'
' Operates using FORMAT$(fd$$,l%%)
'
' Returns the last line on which any text will be printed

b) Function Varit$
Outputs data into a variable
Input
fld$ the contencts to be operated on
l%% the linelength to be used
cr$ the eol charact6ers to use (eg
or CHR$(10))

Output the date in a new format
(3 blank lines constitute end of the original)

top 

fldsize.sbp

Program can be loaded by clicking on its name
To find out how big TXT and EXT (VTX VEX) fields in a used file actually are

top

futil1.sbp

Program can be loaded by clicking on its name
Checks through a file and resizes fields

or at least offers to do so

top 

futil2.sbp

Program can be loaded by clicking on its name
Test for commas in all fields

top 

futil3.sbp

Program can be loaded by clicking on its name
Reorganizes the fields in a file to remove forward referenced calculations
'
' Written: John Barrs 1995
' Uses Superbase v2 Code only
' (therefore useable SBv2 and SB95)
' Reorganizes the fields in a file to remove forward referenced calculations
' Replaces the original file with the new file
'
' Why written: Because forward referencing calculations require increase in calccount
' to ensure that they are correctly stored.
' If field is virtual (non-stored) then the calculation on recovery only uses one pass
' If field is non-stored and indexed, then it **always** will generate errors
'
' To use: CALL ReorgForward()
'
' You may chose to select the field order yourself or let the program decide
' You chose: Offers FieldSelection internal procedure
' Suggest; CLEAR ,Inset All, then drag FIELDS to correct position in order
' Superbase does it
' Sequence: All fields with no calculations are used in the original sequence
' Iterates to add fields:
' each pass adds as many more remaining fields whose references are
' to already included fields
' Disadvantage. All calculated fields appear at bottom of file
'
' Parameter: f$ - file to process
' opened Exclusively
' Uses Temporary Files and Programs
' FWDTEMPZ.SBF (holds file information)
' ZZ.SBF (created as intermediate file)
' FWDTEMPZ.SBP (report to create DBREORG.SBF)
' Uses Own Procedure calls and functions
' SUB FindField()
' FUNCTION IfTake%%
' FUNCTION ChangeF$
' Uses GLOBAL variables
' fct%%,newfct%%
' fld$(array),finf$(array)

top 

futil4.sbp

Program can be loaded by clicking on its name
Various index functions

sample program to use The Index Functions
' written by John Barrs Superbase Developers plc 1997
' to Get Indexes (and if Unique)
' to Strip Indexes (optionally leaving some on)
' to do something - this example reorganizes the file
' to Rebuild Indexes
'

top 

futil5.sbp

Program can be loaded by clicking on its name
Two procs to a) list Sbd files to windows,b) allow edit of sbd files

top 

futil89.sbp

Program can be loaded by clicking on its name
Copy Unique resords from 1 file to another using a IXU

if destination file exists it may optionally be removed and recreated from scourcefile

top 

futilral.sbp

Program can be loaded by clicking on its name
Reorganize all files in a directory

top 

kselect.sbp

Program can be loaded by clicking on its name
Modified Key Select to allow Change of File and Index
' this uses SELECT KEY - therefore it may be called 'SelectKey'

top 

kselect1.sbp

Program can be loaded by clicking on its name
Modified Key Select to allow Change of File and Index
' this uses SelectKey() **** therefore must not be Called 'Selectkey'

top 

outjoin.sbp

Program can be loaded by clicking on its name
Demo to play outerjoin game

end result in File Temp1
' JoinA has all keys in both files
' if both other fields empty then
' JoinA are only in AAA
' JoinAB has those in both
' JoinB_A has those only in BBB

top 

QREP       

How to stop report issuing a blank line
Chris Marshall told me this workaround way back when in the v2 days, and it always works for me:


Code
REPORT
AFTER REPORT
? ;
END REPORT
AFTER SELECT
Form.ListBox.AddItem(Field1.MYFILE + " " +Field3.MyFile)
END SELECT
SELECT ; WHERE $w$ APPEND
END SELECT

The AFTER REPORT block is needed to suppress the blank line. By doing so with a trailing semi-colon, it doesn't
actually print anything to the screen/current view window.

top 

sbfsizes.sbp

Program can be loaded by clicking on its name
Function to return size in bytes of a given sbf file

includes sbd, sbf and all indexes

a&%=GetSBFSize&%()

the file does not have to be open

top 

SET       

A filter counter or two


Code
a) use update

ct%%=0
update ct%%=ct%%+1 WHERE

b) use Set for multiple counts by counting group contents (V3.2)or later

SUB FilterCounter()
ERASE "s"
GLOBAL s AS SET
SELECT UCASE$ aField.MYFILE) WHERE TO SET s
FOR i%% = 1 TO S.Elements.Count
? s.elements(i%%)@12s.GetCount(s.Elements(i%%))
NEXT i%%
END SUB

c)
DIM s$(2000,1)
i%%=0:Tot%%=0:s$(0,0)="Total"
REPORT SUMMARIZE
GROUP Afield.MYFILE
AFTER GROUP AField.MYFILE
IF COUNT THEN ' necessary incase no records match filter
i%%=i%%+1
s$(i%%,0)=GROUP ' store group name
s$(i%%,1)=STR$(COUNT,".")
tot%%=tot%%+COUNT
s$(0,1)=str$(tot%%,".")
END GROUP
SELECT; WHERE ORDER AField.MYFILE APPEND
END SELECT
FOR j%%=1 to i%%
? s$(j%%,0)@12,s$(j%%,1)
NEXT j%%
? "There are "STR$(i%%,"."), "Groups"
? s$(0,0)@12s$(0,1) ' for totals

top 

anzac.sbp

Program can be loaded by clicking on its name
A 'transparent' field simulation by using labels (so that data can appear over images)

' Sub FldtoLabel to place field data into labels on a form
' written by John Barrs - Superbase
'
' designed to be used in conjunction with SUB MakeFieldLab
'
' All (now invisible) textboxes are consulted to see if they have a label replacement stored in their Tag property
' if so, then the text of the textbox is used as the caption of the label
'
' Local variables mfc - textbox control
' mlc - label control
' i%% - loop control
'

top 

CASCDEL       

Cascade delete code for 1 and 2 detblocks

select a record and call .. locks all asociated records whether visible or not and deletes them

CascadeDelit to cascade delete a 1 or 2 level detail-block form
'
'Input parameters
' det1$ = name of detail block 1
' lastbno_det1%% - number of blocks in det1$
' det2$ = name of detail block 2
' lastbno_det2%% - number of blocks in det2$
' det2$ may be "" for a single level (in which case lastbno_det2%% is 0)
'
'to use, select a form with a record you want to delete and then
'
' CALL CascadeDelit("OrdDetBlock",10,"",0)


Simple version for a single detailblock

CascadeDel to cascade delete a 1 level detail-block form
'
'Input parameters
' det$ = name of detail block
' lastbno_det%% - number of rows in detailblock
'
'to use, select a form with a record you want to delete and then
'
' CALL CascadeDel("OrdDetBlock",10)





Code
CascadeDelit to cascade delete a 1 or 2 level detail-block form
'
'Input parameters
' det1$ = name of detail block 1
' lastbno_det1%% - number of blocks in det1$
' det2$ = name of detail block 2
' lastbno_det2%% - number of blocks in det2$
' det2$ may be "" for a single level (in which case lastbno_det2%% is 0)
'
'to use, select a form with a record you want to delete and then
'
' CALL CascadeDelit("OrdDetBlock",10,"",0)

SUB CascadeDelit(det1$,lastbno_det1%%,det2$,lastbno_det2%%)
ENTER END :REM Assumes called from a button on the form
SET LOCK ON :REM to keep locks on during all the selects
MOUSE OFF
SELECT FORM CURRENT LOCK
SELECT FORM FIRST PAGE det1$ LOCK
WHILE NOT ( EODB (det1$))
SELECT FORM NEXT PAGE det1$ LOCK
IF det2$ <> "" THEN CALL DBlocker(det2$,lastbno_det2%%)
WEND
IF det2$ <> "" THEN CALL DBlocker(det2$,lastbno_det2%%)
SELECT FORM REMOVE CASCADE
SET LOCK OFF
SELECT FORM CURRENT
MOUSE ON
FORM
END SUB

SUB DBlocker(dbn$,dbno%%)
FOR i%% = 1 TO dbno%%
SELECT FORM FIRST PAGE dbn$,i%% LOCK
IF DBCOUNT (dbn$,i%%) > 0 THEN
WHILE NOT ( EODB (dbn$,i%%))
SELECT FORM NEXT PAGE dbn$,i%% LOCK
WEND
END IF
NEXT i%%
END SUB
Simple version for a single detailblock

CascadeDel to cascade delete a 1 level detail-block form
'
'Input parameters
' det$ = name of detail block
' lastbno_det%% - number of rows in detailblock
'
'to use, select a form with a record you want to delete and then
'
' CALL CascadeDel("OrdDetBlock",10)

SUB CascadeDel(det$,lastbno_det%%)
ENTER END :REM Assumes called from a button on the form
SET LOCK ON :REM to keep locks on during all the selects
MOUSE OFF
SELECT FORM CURRENT LOCK
SELECT FORM FIRST PAGE det$ LOCK
WHILE NOT ( EODB (det$))
SELECT FORM NEXT PAGE det$ LOCK
WEND
SELECT FORM REMOVE CASCADE
SET LOCK OFF
SELECT FORM CURRENT
MOUSE ON
FORM
END SUB

top 

demdblk2.sbp

Program can be loaded by clicking on its name
to add an OnGotFocus Procedure to all fields in a detailblock
' parameters - optionally only those with named controlsource

' dbname$ the detailblock name
' OnGotFProc$ the name of the OnGotFocus Proc
' controlsc$ - controlsource (may be "" in which case all textboxes in detblock will get the proc)


' eg: to put an OnGotFocus Procedure called JohnsDoit on all fields in detailblock JohnsDB1
'
' a$=AddOnGotF$("JohnsDB1","JohnsDoit")
'

top 

demdbsrt.sbp

Program can be loaded by clicking on its name
to demo changing sortfield on detail blocks

both linked and unlinked

top 

frmwhere.sbp

Program can be loaded by clicking on its name
Set a filter on all files in a form

top 

tabf.sbp

Program can be loaded by clicking on its name
TabForms - demo of form to look like a multipage TABbed Form

top 

utilfrm1.sbp

Program can be loaded by clicking on its name
Analyse forms or reports for details - Written John Barrs Superbase Developers plc. November 1996
' Opens the form or report and analyses its controls and formcontrols
'

top 

utilfrm2.sbp

Program can be loaded by clicking on its name
Analyse forms or reports for details - Written John Barrs Superbase Developers plc. March 1998 - requires SB3.2
' Opens the form or report and analyses its controls and formcontrols
'
NB: requires SB3.2 and handles the OnMiddle and OnRight events

top 

utilfrmc.sbp

Program can be loaded by clicking on its name
sets Enabled to value toggle%% in detail block dbname$ for command buttons
FUNCTION SetCBEnable%%(dbname$,toggle%%)
DIM o AS object
FOR i%% = 1 TO Superbase.Form.Controls.Count
IF Superbase.Form.Controls(i%%).Type LIKE "CommandButton" THEN ' check control is a Cbutton
SET o = Superbase.Form.Controls(i%%)
IF NOT IS (o.DetailBlock, NOTHING ) THEN ' check CButton is in a detailblock
IF o.DetailBlock.Name = dbname$ THEN 'check it is in the correct detailblock
o.Enabled = toggle%%
END IF
END IF
END IF
NEXT i%%
form.Refresh()
END FUNCTION


' runs through the form and tells status of textboxes as to whether they are enabled
FUNCTION CheckTBox$(Enabled%%)
DIM o AS object
FOR i%% = 1 TO Superbase.Form.Controls.Count
IF Superbase.Form.Controls(i%%).Type LIKE "TextBox"
SET o = Superbase.Form.Controls(i%%)
IF o.Enabled = Enabled%% THEN ? o.Name
END IF
NEXT i%%
END FUNCTION

top 

CLOSITE       

To Close all Open Programs


Code
SUB Closeit()
DIM prog$(100)
FILLARRAY prog$,4
SET ERROR OFF 269
FOR i%% = 0 TO 100
IF prog$(i%%) <> "" THEN
CLOSE PROGRAMFILE (prog$(i%%))
CLEAR ERRNO
ELSE
i%% = 999
END IF
NEXT i%%
SET ERROR ON ALL
NEW
END SUB

top 

DDEDEMO       

Two Programs DDEDEMA as Server,DDEDEMB to launch


Code
SUB main()' DDEDEMB
ON ERROR GOTO loglauncherr
x$ = "SB30":a$ = "NO"
DDETERM 1
DDEINIT 1,x$,"anum"
DDEREQ 1,"ifok$",a$
IF a$ LIKE "no" THEN
REQUEST a$:REM not launched
ELSE
REQUEST "Is Running","",2
DDEEXEC 1,"ifok$=~NO~"
END IF
CLEAR ERRNO
DDETERM 1
ON ERROR
END SUB
loglauncherr:
IF ERRNO = 156 THEN REQUEST "156":DDETERM 1:RESUME NEXT
IF ERRNO = 157 THEN REQUEST "157":RESUME NEXT
REQUEST STR$ ( ERRNO ), ERR$ ( ERRNO )
END
******DDEDEMA below here********************************************
SUB DDEProc(t%,command$,topic$)
IF topic$ = "" THEN
REM we got a command -
REQUEST "DDE Received",command$,2
EXECUTE command$
ELSE
DDEREPLY
END IF
END SUB
SUB TimeProc(t&%)
ct%% = ct%% + 1:IF ct%% MOD 6 = 0 THEN ?
? TIME$ (t&%,"hh:mm:ss.a");
IF ct%% >= 20 THEN ifok$ = "NO"
END SUB
SUB A()
ERASE "dlg"
GLOBAL dlg AS Dialog
DIM control AS DialogControl

Superbase.Dialogs.Add("A")
SET dlg = Superbase.Dialogs.A
dlg.Move(108,126,200,63)
dlg.Caption = "DDE Checker"
dlg.FontName = "MS Sans Serif"
dlg.FontSize = 8
dlg.OnActivate = "C"

SET control = dlg.Add("B1","DialogCommandButton")
control.Move(34,16,130,33)
control.Caption = "Wait While Check DDE"
control.ReturnValue = 0
control.Cancel = 1
control.OnClick = "B"
dlg.SetActive()
dlg.Delete()
END SUB
SUB B()
dlg.SetActive(0)
END SUB

SUB C()
EVENTCLASS TIMEVAL ON
END SUB
SUB main()
CLS
GLOBAL ifok$,ct%%
ifok$ = "NO"
ON EVENTCLASS DDEREQ CALL DDEProc()
ON EVENTCLASS TIMEVAL = 1 CALL TimeProc(), REPEAT , EVENTPRIORITY 127
OPEN FILE SHARE ,0"anum"
ifok$ = "YES"
EVENTCLASS MAX 5
EVENTCLASS ALL ON
CALL A()
WHILE ifok$ <> "NO"
REM
WAIT FOR 5
WEND
CLOSE ALL
END SUB

top 

filutil9.sbp

Program can be loaded by clicking on its name
To DDE to hidden copySB to load and save programs as text programs

top 

oupickd.sbp

Program can be loaded by clicking on its name
Set output -- window,printer,diskfile

top

progut_1.sbp

Program can be loaded by clicking on its name
Check what state (text, tokenised, or protected) all programs in a directory are

top 

TIP3.6i       

SUPERBASE 3.6i TIP: PRINT CURRENT USING ... ASK

PRINT CURRENT USING no longer shows dialog when all numeric parameters are
0

PRINT CURRENT USING now has optional last parameter known as ASK and if
you specify the other parameters they will be used as defaults on the
dialog. Similar to the ASK on a SELECT.
-----

BONUS SUPERBASE 3.6i TIP: Dialog object enhancements!

DialogLabel now has Enabled property

DialogLabel objects now have an Enabled property. This allows the text to
be greyed out in case the textbox next to the label is disabled and the
programmer wishes to give the user a visible cue that the textbox (which
may be empty) is disabled.

DialogListBox now has tabbing capability

DialogListBox objects now have an array property called TabPositions that
allows the user to set the tab stops within the DialogListBox. If any tabs
are set, then it will support the TAB character CHR$(9), otherwise it will
not. This allows the user topresent lists of information in columns using
a listbox and also without requiring the user to select a non-proportional
font for the dialog.

top 

wcase.sbp

Program can be loaded by clicking on its name
Function to simulate WCASE$

This one handles all spaces correctly - the next one WCASE_1 (in WCASE.SBP)reduces mutiple spaces to one and trims
trailing spaces

top 

filer_v3.sbp

Program can be loaded by clicking on its name
This is v3 version of filer (file finder) and has an internal directory changer rather than using REQUEST 28 etc

top 

futil7.sbp

Program can be loaded by clicking on its name
Display File Properties
'
' Two mechanisms:
' a) Browse a directory and select from the directory list
' (can reselect from same list or change directory)
' b) Find a file using a wildcard mask on the 8.3 name from anywhere on the machine
'

' Display includes Long Path, Long FileName, Short Path, Short Filename, Date, Time, Size and Attributes
'
' LFN (path and File) and/or SFN can be copied to clip
'

top 

futil93.sbp

Program can be loaded by clicking on its name
to size a directory structure

gives individual and accumulated folder sizes

 

top

 

futil94.sbp

Program can be loaded by clicking on its name
Duplicate a directory structure in TEMP

 

top

 

getdrive.sbp

Program can be loaded by clicking on its name
returns Drivetype for input drive letter
' 0 is Not present
' 2 is Local exchangeable
' 3 is Local hard disk
' 4 is Other (I know CDRom gets 4 and I think Network Drive does too)
' Note::: Windows API call will Hang if you specify a drive letter higher than LastDrive
' Examples of Use
' IF JBGetDrivTyp%%("B") = 0 THEN REQUEST "No B-DRive Present"
' IF JBGetDrivTyp%%( DIRECTORY ) = 3 THEN REQUEST "Currently in a Directory in a Local Hard Disk"

 

top

 

locktype.sbp

Program can be loaded by clicking on its name
Gets Lock type (LAN Dist, Singele) of current SB (v3)

 

top

 

sb30ini.sbp

Program can be loaded by clicking on its name
read Sb30 ini file and returns value associated with p$
' eg if p$ =Pgmrufile1 then returns the top MRU program Editor file
'
' requires WINDirectory$ to locate windows directory *(in code below)
'
' returns nothing if the called string doesn't exist
' returns nothing if the value is not assigned (eg on my system 'machine=')
'
is also a program for v2 called SBv2INI.SBP

top 

srchmsk.sbp

Program can be loaded by clicking on its name
Find a string in a directory

srchmsk
select directory and and a file in it - that will be used to define *.ext to search for a string
optionally subdirs
optionally whole word and case sensitivity
output to windows text or 'Answer'

 

top

 

WINDIR       

Get WinDir
(in procs dll library SB30)


Code
*************************************************************************

' * WINDirectory$() - Get the directory that Windows is in
' *
' * Example: DIRECTORY WINDirectory$()
' * Result : This would change the current directory in Superbase to
' * the directory where windows is (assuming that it is on the
' * current physical drive).
' *************************************************************************
FUNCTION WINDirectory$()
REM ***********************************************************************
REM * Declare all local variables as local
REM ***********************************************************************
DIM Null%%
REM ***********************************************************************
REM * Register DLL functions
REM ***********************************************************************
REGISTER CLEAR
REGISTER "KERNEL.EXE","GetWindowsDirectory","HFI"
Null%% = CALL ("GetWindowsDirectory",WINDirectory$,144)
REGISTER CLEAR
END FUNCTION

 

top