(80) FC SmallBasic Complements API リファレンス インデックス (アルファベット順)

先日、(71) FC SmallBasic Complements で、FC SmallBasic Complements という Small Basic の拡張機能を紹介したわけですが。
ちょっと自分でも使いたくなりましたので、実際に実装されている機能の一覧をメモしておくことにしました。

翻訳までしている時間をまとめて取ることができないので、当座は英文のまま整理した状態で。
そのうち少しずつ日本語に置き換えていくかもしれませんはっはっは。


Clipboard

This class provides functions to ask things to the user through the UI.

CopiedImage プロパティ Get or set the image in the clipboard.
returns : Image.
CopiedText プロパティ Get or set the text in the clipboard.
returns : Text copied.
GetText ( ) オペレーション Return the value of the current copied text.
returns : Text copied.
SetText ( value ) オペレーション Modify the current copied text.
value : Text to copy.

Controls

This class provides better support for Shapes in GraphicWindow.

You should use this class as an extension of the native Shapes object introduced in Small Basic v0.3.
You'll find here many similar functions, and some news.

notes : Before using any controls (Button, TextBox, …), please make sure you've called the LoadTheme function.

AddButton
  ( Width , Height , Text )
オペレーション Add a button to the Window.
Width : Width
Height : Height
Text : Text
returns : The button.
AddCheckBox ( Text ) オペレーション Add a checkbox to the Window.
Text : Text
returns : The checkbox.
AddEllipse
  ( Width  , Height )
オペレーション Add an ellipse to the Window.
Width : Width
Height : Height
returns : The ellipse.
AddImage ( Src ) オペレーション Add an image to the Window.
Src : The name of a loaded image, or a location to a image file.
returns : The image's display box.
AddLabel
   ( Width , Height , Text )
オペレーション Add a label to the Window.
Width : Width
Height : Height
Text : Text
returns : The label.
AddMultilineTextBox
   ( Width , Height , Text )
オペレーション Add a multiline textbox to the Window.
Width : Width
Height : Height
Text : Text
returns : The textbox.
remarks : A new line is created, in Windows, by having the CrLf sequence in the string. CrLf = Text.GetCharacter(13) + Text.GetCharacter(10)
AddPolygon
   ( PointsArray )
オペレーション Add a polygon to the Window
PointsArray : An array containing the X and Y coordinates of each point of the polygon.
returns : The polygon.
AddProgressBar
  ( Width , Height , Percentage )
オペレーション Add a progress bar to the Window.
Width : Width
Height : Height
Percentage : The percentage of fullness of the progress bar at start (editable with SetText).
returns : The progress bar.
remarks : Please note you can use SetText / GetText to set/get the value of the progress bar.
AddRectangle
   ( Width , Height )
オペレーション Add a rectangle to the Window.
Width : Width
Height : Height
returns : The rectangle.
AddTextBox
   ( Width , Height , Text )
オペレーション Add a textbox to the Window.
Width : Width
Height : Height
Text : Text
returns : The textbox.
AddTriangle
  ( X1 , Y1 , X2 , Y2 , X3 , Y3 )
オペレーション Add a triangle to the Window.
X1 : The X coordinate of the first point
Y1 : The Y coordinate of the first point
X2 : The X coordinate of the second point
Y2:  The Y coordinate of the second point
X3 : The X coordinate of the last point
Y3 : The Y coordinate of the last point
returns : The triangle.
AddWebBrowser
   ( Width , Height )
オペレーション Add a webbrowser control to the Window. Use GetUrlOfWebBrowser/SetUrlOfWebBrowser to modify the URL of this control.
Width : Width
Height : Height
returns : The control.
remarks : By default, no page is loaded, so you'll need to use SetUrlOfWebBrowser at least a time.
ElementFromPoint
  ( DistanceFromLeft
  , DistanceFromTop )
オペレーション Get the control/shape located at the specified position, or return "" if no control is located at this point.
DistanceFromLeft : The X coordinate of the point.
DistanceFromTop : The Y coordiante of the point.
returns : The name of a Shape, or "".
GetAllShapes ( ) オペレーション Returns an array containing the name names of the shapes displayed in the current GraphicsWindow.
returns : An array containing all the names.
GetBackground ( Shape ) オペレーション Return the background of a shape, if this shape have a background color.
Shape : The Shape to modify
returns : The color of the background, or "".
GetBorderColor ( Shape ) オペレーション Return the border color of a shape, if this shape have a border color.
Shape : The Shape to modify
returns : The color of the border, or "".
GetBottom ( Shape ) オペレーション Return the Y-Location of the bottom of a shape
Shape : The shape
returns : The location
GetChecked ( Shape ) オペレーション Return the checked state of a shape, if any
Shape : The shape
returns : The checked state ("True" or "False").
GetHeight ( Shape ) オペレーション Return the height of a shape.
Shape : The shape
returns : The height, as decimal number.
GetLeft ( Shape ) オペレーション Return the distance separating the left of the window and the shape, also called X-Location.
Shape : The shape to consider
returns : The location
GetOpacity ( Shape ) オペレーション Return the opacity of a shape, if any
Shape : The shape
returns : The opacity, as a Number between 0 and 1
remarks : It's possible that some elements don't support opacity.
GetRight ( Shape ) オペレーション Return the X-Location of the right of a shape.
Shape : The shape
returns : The location
GetRotationAngle ( Shape ) オペレーション Return the angle from the horizontal that's applied to a shape.
Shape : The rotated shape
returns : An angle, in degree
GetShapeAsNative ( Shape ) オペレーション Return a shape, as a native XAML object.
Shape : The shape to convert
returns : The native object
remarks : This functions is only useful for .NET experts. You'll need the Interop object to use the returned value.
GetText ( Shape ) オペレーション Return the text of a shape, if any.
Shape : The shape
returns : The text, as String.
GetTop ( Shape ) オペレーション Return the distance separating the top of the window and the shape, also called Y-Location.
Shape : The shape to consider
returns : The location.
GetUrlOfWebBrowser
  ( WebBrowserCtrl )
オペレーション Get the url of a WebBrowser control; or do something on it like going back, …
WebBrowserCtrl : A webbrowser
GetWidth ( Shape ) オペレーション Return the width of a shape.
Shape : The shape
returns : The width, as decimal number.
IsFocused ( Shape ) オペレーション Return "True" if the control has the focus, "False" otherwhise.
Shape : The shape
returns : "True"/"False"
IsMoveOver ( Shape ) オペレーション Return "True" if the mouse is over the shape, "False" otherwhise.
Shape : The shape
returns : "True"/"False"
LastEventSource ( ) オペレーション Return the last control that raised an event.
returns : The name of a Shape or a Control.
LoadTheme ( Name ) オペレーション Load a theme for your buttons and inputs.
Name : "Vista", "XPBlue", "XPSilver", "XPGreen", "XPRoyale", "Classic" or "Default"
remarks : "Default" means that this function will use the nearest usable theme.
If you're using Vista, it will be "Vista".
If your're using post-Vista system, it will be "Vista" too.
If you're using XP, it will be "XPBlue".
If you're using a pre-XP system, it will be "Classic".
Move ( Shape , X , Y ) オペレーション Move the Shape at specified location.
Shape : The shape
X : X-Location
Y : Y-Location
MoveAsAnimation
  ( Shape , X , Y , Duration )
オペレーション Move the Shape at specified location as an animation.
Shape : The shape
X : X-Location
Y : Y-Location
Duration : The time the animation will take, in miliseconds
MoveAsAnimationBy
  ( Shape , X , Y , Duration )
オペレーション Translate the specified shape with the [DeltaX, DeltaY] vector, in 'Duration' miliseconds.
Shape : The shape to move
DeltaX : The value to add to X-Location
DeltaY : The value to add to Y-Location
Duration : The time, in miliseconds, that the Animation will take
MoveBy
  ( Shape , DeltaX , DeltaY )
オペレーション Translate the specified shape with the [DeltaX, DeltaY] vector.
Shape : The shape to move
DeltaX : The value to add to X-Location
DeltaY : The value to add to Y-Location
RegisterEvent
   ( Shape , EventName
   , SubName )
オペレーション Register to a Shape's event.
Shape : The shape
EventName : The name of the event
SubName : The name of the sub
RegisterKeyDownEvent
  ( Shape , SubName )
オペレーション Register to the specified event.
Shape : The shape from which we register the event
SubName : The sub that get called when the event is raised
RegisterKeyUpEvent
  ( Shape , SubName )
オペレーション Register to the specified event.
Shape : The shape from which we register the event
SubName : The sub that get called when the event is raised
RegisterMouseDownEvent
  ( Shape , SubName )
オペレーション Register to the specified event
Shape : The shape from which we register the event
SubName : The sub that get called when the event is raised
RegisterMouseEnterEvent
  ( Shape , SubName )
オペレーション Register to the specified event.
Shape : The shape from which we register the event
SubName : The sub that get called when the event is raised
RegisterMouseLeaveEvent
  ( Shape , SubName )
オペレーション Register to the specified event.
Shape : The shape from which we register the event
SubName : The sub that get called when the event is raised
RegisterMouseMoveEvent
  ( Shape , SubName )
オペレーション Register to the specified event.
Shape : The shape from which we register the event
SubName : The sub that get called when the event is raised
RegisterMouseUpEvent
  ( Shape , SubName )
オペレーション Register to the specified event.
Shape : The shape from which we register the event
SubName : The sub that get called when the event is raised
Remove ( Shape ) オペレーション Permantly delete a shape from the Window and the memory.
Shape : The shape to delete
SetBackground
  ( Shape , Color )
オペレーション Modify the background of a shape, if this shape have a background color.
Shape : The Shape to modify
Color : The new color of the background
returns : "True", if it worked; "False" otherwhise.
SetBorderColor
  ( Shape , Color )
オペレーション Modify the border color of a shape, if this shape have a border color.
Shape : The Shape to modify
Color : The new color of the border
returns : "True", if it worked; "False" otherwhise.
SetChecked ( Shape , Value ) オペレーション Modify the checked state of a shape, if any.
Shape : The shape
Value : The checked state ("True" or "False")
SetHeight ( Shape , Value ) オペレーション Modify the height of a shape.
Shape : The shape
Value : The height, as decimal number
SetImageSource
  ( ImageControl , Src )
オペレーション Allow to change the image displayed in an image control.
ImageControl : The ImageControl you want to modify
Src : The new image to show (either a file path or a loaded image in the ImageList)
SetLeft ( Shape , NewLeft ) オペレーション Modify the Y-Location of a shape.
Shape : The shape to move
NewLeft : The new Y-location of the shape
SetOpacity
   ( Shape , NewOpacity )
オペレーション Modify the opacity of a shape.
Shape : The shape
NewOpacity : The opacity, as a Number between 0 and 1
SetRotationAngle
  ( Shape , Angle )
オペレーション

Rotate the shape of 'Angle' degree from 0°.
Shape : The shape to rotate
Angle : The angle to apply, in degree

SetText ( Shape , NewText ) オペレーション Modify the text of a shape, if any.
Shape : The shape
NewText : The text, as String
SetTop ( Shape , NewTop ) オペレーション Modify the X-Location of a shape
Shape : The shape to move
NewTop : The new X-Location of the shape
SetUrlOfWebBrowser
  ( WebBrowserCtrl , URL )
オペレーション Set the url of a WebBrowser control; or do something on it like going back, …
WebBrowserCtrl : A webbrowser
URL : "GoBack", "GoForward", or an url
SetWidth ( Shape , Value ) オペレーション Modify the width of a shape
Shape : The shape
Value : The width, as decimal number
Zoom ( Ctrl , Factor ) オペレーション Allow to make a control bigger or smaller.
Ctrl : The control to zoom in/out
Factor : The factor to use (1 to conserve same size, 2 to make two times bigger …)
remarks : Controls.Zoom conserve the old zoom factor. Controls.Zoom(C, 2) Controls.Zoom(C, 3) would produce a x6 zoom on C.

DataFile

This class provides support for reading and writing of data files.

CanReadAnything
  ( DataFileID )
オペレーション Checks if ReadType() don't return "None". It don't check if the next data will be recognized.
DataFileID : The data file reader
returns : Nothing
CloseDataFile ( DataFileID ) オペレーション Close a data file wrapper. If the wrapper was a file writer, it saves the data file to the place.
DataFileID : The data file wrapper (reader or writer)
returns : Nothing
CreateNewFileReader ( File ) オペレーション Create a new handle to a data file reader.
File : The place of the file that will be loaded
returns : A number that is the handle to a data file writer
CreateNewFileWriter
  ( File , ErraseData )
オペレーション Create a new handle to a data file writer.
File : The place where the data will be writed when the CloseDataFile method will be called
ErraseData : Indicates if the (old) data of the file should be conservated ("False") or not ("True")
returns : A number that is the handle to a data file writer
ReadArray ( DataFileID ) オペレーション Return the next data to read, if it's an array.
DataFileID : The data file reader
returns : The array contained in the file, or ""
remarks : Checks the type with ReadType()
ReadStack 
  ( DataFileID , StackName )
オペレーション Return the next data to read, if it's a stack.
DataFileID : The data file reader
StackName : The name of the stack to update
returns : Nothing
remarks : Checks the type with ReadType()
ReadType ( DataFileID ) オペレーション Return the type of the next data to read, if any.
DataFileID : The data file reader
returns : "Variable", "Array", "Stack" or "None"; anything else can be returned, but then it's similar to "None"
ReadVariable ( DataFileID ) オペレーション Return the next data to read, if it's a variable.
DataFileID : The data file reader
returns : Nothing
remarks : Checks the type with ReadType()
WriteArray ( DataFileID , Array ) オペレーション Writes an array into a data file wrapper.
DataFileID : The data file writer
Array : The arrray to write in the file writer
returns : "False"/"True"
WriteStack
  ( DataFileID, StackName )
オペレーション Writes a stack into a data file wrapper.
DataFileID : The data file writer
StackName : The stack to write in the file writer
returns : "False"/"True"
WriteVariable
  ( DataFileID , Variable  )
オペレーション Writes a variable into a data file wrapper.
DataFileID : The data file writer
Variable : The variable to write in the file writer
returns : "False"/"True"

Dialogs

This class provides functions to ask things to the user through the UI.

AskForColor ( ) オペレーション Ask the user for a color.
returns : Return the color chosen by the user, or "".
AskForDirectory ( ) オペレーション Ask the user for a directory.
returns : Return the name of the chosen directory, or "".
AskForFile ( ) オペレーション Ask the user for a file.
returns : Return the name of a file to open, or "".
AskForFile2 ( FileExtension ) オペレーション Ask the user for a file by specifying an extension for the file.
FileExtension : The extension of the file you want
returns : Return the name of a file to open, or "".
AskForFont ( ) オペレーション Ask the user for a font.
returns : Return the font chosen by the user in the format "Size|FontName", or "".
AskForLoginCredentials ( ) オペレーション Ask the user for a login and a password.
returns : "Login:Password"
AskForSaveLocation ( ) オペレーション Ask the user for a place to save a file.
returns : Return the name of a file to save, or "".
AskForSaveLocation2 ( ) オペレーション Ask the user for a place to save a file by specifying an extension for the file.
returns : Return the name of a file to save, or "".
AskForTextLine ( Prompt ) オペレーション Ask the user for a line of text, with the specified prompt line.
Prompt : A sentence that explain what you want the user types
returns : The line of text the user type, or ""
AskForYesNo ( Msg ) オペレーション Show a dialog that ask the user for selecting "Yes" or "No".
Msg : The message shown to the user
returns : "Yes" or "No"
AskForYesNoOrCancel ( Msg ) オペレーション Show a dialog that ask the user for selecting "Yes", "No" or "Cancel".
Msg : The message shown to the user
returns : "Yes", "No" or "Cancel"
ShowMessage ( Msg ) オペレーション Show a message to the user.
Msg : The message to show
returns : An empty string ("")
ShowMessageAsError ( Msg ) オペレーション Show an error message to the user.
Msg : The message to show
returns : An empty string ("")
ShowMessageAsInformation
  ( Msg )
オペレーション Show an information message to the user.
Msg : The message to show
returns : An empty string ("")
ShowMessageAsWarning
  ( Msg )
オペレーション Show a warning message to the user.
Msg : The error message to show
returns : An empty string ("")
T_ErrorDialogTitle プロパティ Translation of the title of the dialogs that show an error to the user.
value : The title of error dialogs, default to "Error"
returns : The value of the title, as String
T_InformationDialogTitle プロパティ Translation of the title of the dialogs that show a message to the user.
value : The title of message dialogs, default to "Message"
returns : The value of the title, as String
T_LoginDialogPassWord プロパティ Translation of "Password :" in your language.
T_LoginDialogTitle プロパティ Translation of the title of the dialogs that ask credentials to the user in your language.
value : The title of login dialogs
returns : The value of the title, as String
T_LoginDialogUserName プロパティ Translation of "Username :" in your language
T_PromptDialogTitle プロパティ Translation of the title of the dialogs that ask something to the user.
value : The title of prompt dialogs, default to "Prompt dialog"
returns : The value of the title, as String

Drawings

This class provides some functions about Images and Colors.

CreateEmpyGraphics ( ) オペレーション Create a graphical representation with a size of Width*Height, on which you can perform operations.
returns : A native Graphics object
remarks : Use the GenerateImage method to get a visual representation of a Graphics object.
CreateGraphics ( ImageSrc ) オペレーション Create a graphical representation of an image, on which you can perform operations.
ImageSrc : Name of an image in the ImageList, or path to a file
returns : A native Graphics object
remarks : Use the GenerateImage method to get a visual representation of a Graphics object.
CreateGraphicsFromControl
  ( Ctr )
オペレーション Create a graphical representation of a control or shape, on which you can perform operations.
Ctr : The control you want to transform to an image
returns : A native Graphics object
remarks : Use the GenerateImage method to get a visual representation of a Graphics object.
CreateGraphicsFromUI ( ) オペレーション Create a graphical representation of your GraphicsWindow object, on which you can perform operations.
returns : A native Graphics object
remarks : Use the GenerateImage method to get a visual representation of a Graphics object.
DrawClosedCurve
  ( GraphicsObject
   , LineColor
   , Width
   , PointsArray )
オペレーション Draw a closed curve on the specified Graphics.
GraphicsObject : The Graphics to modify
LineColor : The color of the line
Width : The thickness of the line
PointsArray : An array containing the X and Y coordinates of each point of the curve
DrawCurve
  ( GraphicsObject
   , LineColor
   , Width
   , PointsArray )
オペレーション Draw a curve on the specified Graphics.
GraphicsObject : The Graphics to modify
LineColor : The color of the line
Width : The thickness of the line
PointsArray : An array containing the X and Y coordinates of each point of the curve.
DrawLine
  ( GraphicsObject , LineColor
   , Width , x0 , y0 , x1 , y1 )
オペレーション Draw a line on the specified Graphics.
GraphicsObject : The Graphics to modify
LineColor : The color of the line
Width : The thickness of the line
x0 : Left location of the start point
y0 : Top location of the start point
x1 : Left location of the end point
y1 : Top location of the end point
DrawRectangle
  ( GraphicsObject . LineColor
   , Width , x0 , y0
   , RectWidth , RectHeight )
オペレーション Draw a rectangle on the specified Graphics.
GraphicsObject : The Graphics to modify
LineColor : The color of the line
Width : The thickness of the line
x0 : Left location of the start point
y0 : Top location of the start point
RectWidth : Width of the rectangle
RectHeight : Height of the rectangle
FillClosedCurve
  ( GraphicsObject , LineColor
   , PointsArray )
オペレーション Fill a closed curve on the specified Graphics.
GraphicsObject : The Graphics to modify
LineColor : The color of the line
PointsArray : An array containing the X and Y coordinates of each point of the curve
FillEllipse
  ( GraphicsObject , LineColor
   , x0 , y0 , EllWidth , EllHeight )
オペレーション Fill an ellipse on the specified Graphics.
GraphicsObject : The Graphics to modify
LineColor : The color of the line
x0 : Left location of the start point
y0 : Top location of the start point
EllWidth : Width of the ellipse
EllHeight : Height of the ellipse
FillRectangle
  ( GraphicsObject , LineColor
   , x0 , y0
   , RectWidth , RectHeight )
オペレーション Fill a rectangle on the specified Graphics.
GraphicsObject : The Graphics to modify
LineColor : The color of the line
x0 : Left location of the start point
y0 : Top location of the start point
RectWidth : Width of the rectangle
RectHeight : Height of the rectangle
GenerateImage
  ( GraphicsObject )
オペレーション Get a visual representation of the object that you can use in the ImageList object.
GraphicsObject : The native Graphics object to convert
returns : An image
GeneratePartialImage
  ( GraphicsObject )
オペレーション Get a visual representation of a part of the object that you can use in the ImageList object.
GraphicsObject : The native Graphics object to convert
returns : An image
GetAlphaOfColor ( Color ) オペレーション Returns the Alpha composant of a color.
Color : The color
returns : A number from 0 to 255.
GetBlueOfColor ( Color ) オペレーション Returns the Blue composant of a color.
Color : The color
returns : A number from 0 to 255
GetColorFromRGB ( R , G , B ) オペレーション Return a color form its Red, Green and Blue composants.
R : Red (0 to 255)
G : Green (0 to 255)
B : Blue (0 to 255)
returns : A color.
GetColorFromRGBA
( R , G , B , AlphaOpacity)
オペレーション Return a color form its Red, Green, Blue and Alpha composants.
R : Red (0 to 255)
G : Green (0 to 255)
B : Blue (0 to 255)
AlphaOpacity : Opacity of the color (0 to 255), 0 beeing fully transparent and 255 beeing fully opaque
returns : A color.
GetGreenOfColor ( Color ) オペレーション Returns the Green composant of a color.
Color : The color
returns : A number from 0 to 255.
GetRandomColor ( ) オペレーション Returns a randomly-generated color.
returns : A color.
GetRedOfColor ( Color ) オペレーション Returns the Red composant of a color.
Color : The color
returns : A number from 0 to 255.
Invert ( Color ) オペレーション Return the color that's the opposite of another.
Color : The color to invert
returns : A color.
MakeLighterOrDarker
  ( Color , Coeff )
オペレーション Change the luminosity of a color by multiplying all composants by Coeff.
Color : The base color
Coeff : A coefficient. 1 to keep the same color, greater than 1 to make lighter, smaller than 1 to make darker
returns : A color.
remarks : Using a too great value for Coeff can have as result a modification of the coloration. Using a negative coeff can have strange results.
ReleaseGraphics
  ( GraphicsObject )
オペレーション Remove a graphic from the memory when you don't use it anymore.
GraphicsObject : The Graphics to remove from the memory
remarks : You should always call this method when you don't plan to use a Graphics anymore, because if you don't, it stay in memory.
ReleaseImageFromImageList
  ( ImageName )
オペレーション Remove an image of the ImageList object from the memory when you don't use it anymore.
ImageName : The Image (in the ImageList) to remove from the memory
remarks : You should always call this method when you don't plan to use an image anymore, because if you don't, it stay in memory.
SaveGraphicsToFile
  ( GraphicsObject , FileName)
オペレーション Save a Graphics object to an image file.
GraphicsObject : The Graphics object to save in a file
FileName : The path of the file where to save the image. It must end by one one the following string : "PNG", "JPG", "JPEG", "BMP" or "GIF".
remarks : If your filename doesn't end by one of the expected string, the file type will be "PNG".

FTP

DownloadFile
  ( serverFilePath
  , localFilePath
  , userName
  , password )
オペレーション Download an FTP file.
serverFilePath : Path on the server (file to copy)
localFilePath : Path on the computer (save location)
userName : FTP's username
password : FTP's password
returns : "SUCCESS" if it worked, an error message if something goes wrong
UploadFile
  ( serverFilePath
  , localFilePath
  , userName
  , password )
オペレーション Upload a file to FTP.
serverFilePath : Path on the server (save location)
localFilePath : Path on the computer (file to copy)
userName : FTP's username
password : FTP's password
returns : SUCCESS" if it worked, an error message if something goes wrong

Instances

This class provides support for Multiple Instances Applications.
By having more than one instance, you can have more than one window opened at a time.

Add
  ( MainSub , ArgsArrayName )
オペレーション Create a new instance of the application.
MainSub : The sub you want that MainSub calls
ArgsArrayName : An array containing the arguments you want to pass to the instance
returns : An ID that represents the instance
CallSub
  ( Instance , SubName )
オペレーション Call a sub in a specified instance.
Instance : The instance in which the sub is called
SubName : The name of the sub to call
EvalCode ( Instance , Code ) オペレーション Evaluate code on another instance, using the SmallBasic.Eval(code) Sub.
Instance : The instance in which the code is run
Code : The code to execute (please note the remarks about this functionnality in SmallBasic.Eval)
remarks : The Eval method doesn't provide full support of Small Basic. For example, you can't create variables/subs.
GetVariable
  ( Instance , VariableName )
オペレーション Return the value of a variable in an instance.
Instance : The instance in which the variable is read
VariableName : The name of the variable
returns : The value of the variable.
IsMainInstance プロパティ Return "True" if this instance is the main instance of the application "False" otherwhie.
value : A boolean
returns : "True"/"False"
MainInstance プロパティ Return the ID of the main instance of the application, or -1 if this instance is the maininstance.
value : The ID
returns : The ID
MainSub ( DefaultSub ) オペレーション If you want to make your application MIA-Compatible, this sub must be your main Sub.
DefaultSub : The sub you want to call if this instance has no constraint
RaiseEvent
  ( Instance , EventName )
オペレーション Raise a custom SmallBasic's event in an instance.
Instance : The instance in which the event is raised
EventName : The name of the event to raise
SetVariable
  ( Instance , VariableName
  , Value )
オペレーション Set the value of a variable in an instance.
Instance : The instance in which the variable is read
VariableName : The name of the variable</param>
Value : The value of the variable</param>

Interop

This class provides functions that allow interoperability between Small Basic and the DotNet FrameWork.

AddEventHandler
  ( ObjH , EventName
  , DelegateH )
オペレーション Add an event handler to a source.
ObjH : The source
EventName : The name of the event
DelegateH : The delegate to add
returns : "True"/"False"
CallSharedSub
  ( TypeName , SubName
  , ArgsArray )
オペレーション This function allows the call a shared function of a native object.
TypeName : The type from which to call the function
SubName : The name of the function to call
ArgsArray : The array used to send parameters, or ""
returns : The result of the function, or Nothing if the call failled
CallSub
  ( H , SubName , ArgsArray )
オペレーション This function allows the call a function of a native object.
H : A native object
SubName : The name of the function to call
ArgsArray : The array used to send parameters, or ""
returns : The result of the function, or Nothing if the call failled
ConvertDelegate
  ( DelH , DelegateTypeName )
オペレーション Wrap a Small Baisc delegate (or any delegate taking no parameter) in another type of delegate.
DelH : The Small Basic delegate to wrap
DelegateTypeName : The type of the new delegate
returns : A native delegate.
remarks : Parameters passed to the delegate are not passed to the inner delegate.
ConvertNativeArray
  ( H , AsNative )
オペレーション Create a Small Basic array from a native array you've got from the Interop module.
H : The native array you want to copy
AsNative : "True" if you want to get native objects, "False" if you want to get Small Basic objects (string, …)
returns : The converted array, or "" if the operation failled.
ConvertSubToDelegate
  ( SubName )
オペレーション Return a delegate for the 'SubName' sub, as a native object.
SubName : The name of the sub you want to wrap
CreateObject
  ( TypeName , ArgsArray )
オペレーション This function allows to create a native object from its name and some parameters to send to the constructor of the object.
TypeName : The type of the object to create
ArgsArray : The array used to send parameters, or ""
returns>The native object create, or Nothing if the constructor failled.
remarks : When you don't need an object anymore, don't forget to call ReleaseObject before deleting the last reference to it in your program because it will result to a memory leak because the object will not be deleted from the memory.
GetDefault ( ObjH , IndexH ) オペレーション This function returns, as a native object, ObjH(IndexH).
ObjH : The array or indexed object
IndexH : The index
returns : The object at 'IndexH' position in 'ObjH'.
GetPropertyValue
  ( H , PropertyName
  , ArgsArray )
オペレーション This function allows you to set a property on a native object.
H : A native object
PropertyName : The name of the property
ArgsArray : The array used to send parameters, or ""
returns : The value of the property (or Nothing if the function failled into the retreiving).
InteropObjectsAmount プロパティ Return the amount of stored Interop Objects.
InvokeDelegate
   ( H , ArgsArray )
オペレーション Return, as a native object, the value returned by calling the specified delegate.
H : The delegate
ArgsArray : The array containing the params to send, or ""
ReleaseAllObjects オペレーション Delete all interop objects permantly of the memory.
remarks : It's important to do this after using the Interop
because a lot of objects will stay in memory because
you have get them but not released.
ReleaseObject ( H ) オペレーション Delete an object permantly of the memory.
H : The handle of the object to delete
remarks : If you want to perform a whole cleanup, use ReleaseAllObjects instead.
RemoveEventHandler
  ( ObjH , EventName
  , DelegateH )
オペレーション Remove an event handler to a source.
ObjH : The source
EventName : The name of the event
DelegateH : The delegate to Remove
returns : "True"/"False"
SetPropertyValue
  ( H , PropertyName
  , NewValueH , ArgsArray )
オペレーション This function allows you to set a property on a native object.
H : A native object
PropertyName : The name of the property
NewValueH : The new value of the property
ArgsArray : The array used to send parameters, or ""
returns : True if it worked, False if it failled
ToNativeArray ( Array ) オペレーション Return a native array from a Small Basic array.
Array : A Small Basic array
returns : An Object() array
remarks : If you want to create a typed native array, use ToTypedNativeArray instead.
ToNativeBoolean オペレーション Return a native boolean from another object.
ToNativeDouble オペレーション Return a native double from another object.
ToNativeInteger オペレーション Return a native string from another object.
ToNativeString オペレーション Return a native string from another object.
ToNumber オペレーション Return the numerical value of a native object or a string.
ToTypedNativeArray
  ( Array , TypeName )
オペレーション Return a native array from a Small Basic array.
Array : A Small Basic array
TypeName : The type of the array you want to create
returns : An Object() array
remarks : If a conversion of an element of the array fail, nothing is used instead

Keyboard

This class provides support for the KeyBoard in Small Basic.

IsAltPressed プロパティ Indicate if the ALT touch is pressed.
value : "True" or "False"
returns : "True" or "False"
IsControlPressed プロパティ Indicate if the CTRL touch is pressed.
value : "True" or "False"
returns : "True" or "False"
IsShiftPressed プロパティ Indicate if the SHIFT touch is pressed.
value : "True" or "False"
returns : "True" or "False"
LastReceivedKey プロパティ Return the last key received by the GraphicsWindow.
value : A key name
returns : A key name
remarks : Returns the same value as GraphicsWindow.LastKey.
ClearAll ( ) オペレーション Deletes all property of the setting file.
     

Settings

This class provides support for settings in your applications.

remarks : Changing your settings too many times can slow down your application.

ClearAll ( ) オペレーション Deletes all property of the setting file.
Get ( PropertyName ) オペレーション Return the value of the 'PropertyName' property in the setting file.
PropertyName : The property name
returns : The value of the property, or ""
Set
  ( PropertyName , StrValue )
オペレーション Return the value of the 'PropertyName' property in the setting file.
PropertyName : The property name
StrValue : The value of the property, or "" to delete the property
SettingFile オペレーション

SmallBasic

This class provides extensions of the Small Basic Language.

remarks : It's possible that some features provided here will be implemented natively by future versions of Small Basic.

AsyncCall ( SubName ) オペレーション Call asynchronously the sub called 'SubName'.
SubName : The sub
returns : The ID of the created thread
AsyncIsRunning ( TID ) オペレーション Return "True" if the thread is currently running.
TID : The ID of a thread
returns : "True"/"False"
AsyncStop ( TID ) オペレーション Stop the execution of all opened threads. For example, you can call it before the application closes.
TID : The ID of a thread
AsyncStopAll オペレーション Stop the execution of the specified thread.
ATan ( Tan ) オペレーション Complements to the Math Object that allow computing the arctangent of a number.
Tan : The tangent
returns : The angle, in radians, who have Tan as tangent
ATan2 ( Dy , Dx ) オペレーション Complements to the Math Object that allow computing the arctangent of a fraction.
Dy : The numerator of the tangent
Dx : The denominator of the tangent
returns : The angle, in radians, who have Tan as tangent
Call オペレーション Call the sub that have the specified name.
SubName : The name of the sub
returns : The return value of the sub (supposed to be empty)
CallAndReturn
  ( SubName , returns )
オペレーション Call the sub that have the specified name and return the value at top of the 'ReturnValue' stack.
SubName : The name of the sub
returns : The value at top of the 'ReturnValue' stack, or Nothing
CreateEvent ( EventName ) オペレーション Create a new event that your application can raise.
EventName : The event
Eval ( SmallBasicCode ) オペレーション Evaluate the 'Code' string.
SmallBasicCode : The SmallBasic code to execute
returns : "True"/"False"
remarks : THIS FUNCTION HAS COMPATIBILITY PROBLEMS :
* You can't create sub or variable here; if you try, your code will not run.
GetAllSubs オペレーション Return, separated by CrLf[13,10], the name of all subs declared by this program.
returns : An array containing all sub names
GetAllVariables オペレーション Return, separated by CrLf[13,10], the name of all variables declared by this program.
returns : An array containing all variable names.
IsNumber オペレーション Return "True" if the variable is a number, "False" otherwhise.
Variable : The variable to check
returns : "True" or "False"
MathEval ( LineOfCode ) オペレーション Evaluate a statement whitout any call to a function. This function take less time than SmallBasic.Eval.
LineOfCode : The line of code to evaluate
returns : The value of the statment.
remarks : Sample of valid statement : "5+3*VarName"
RaiseEvent ( EventName ) オペレーション Raise the specified event.
EventName : The event
RegisterSubToEvent
  ( EventName , SubName )
オペレーション Register a sub to an event.
EventName : The event
SubName : The sub
SetInterval
  ( SubName , Time
  , MaxIteration )
オペレーション Create an asynchrounous thread that will call 'SubName' each 'Time' miliseconds.
SubName : The name of the sub
Time : The time between each call
MaxIteration : The maximum number of call, or -1
returns : A thread's ID
SetTimeout
  ( SubName , Time )
オペレーション Create an asynchrounous thread that will call 'SubName' after 'Time' miliseconds.
SubName : The name of the sub
Time : The time to wait before calling the sub
returns : A thread's ID
TextWindow_ReadKey オペレーション Returns the key that's currently pressed in the text window, or "".
returns : A key.
UnRegisterSubToEvent
  ( EventName , SubName )
オペレーション Unregister a sub to an event.
EventName : The event
SubName : The sub

Xml

This class provides support for XML documents.

remarks : The use of this class requires a minimal XML knownledge.

CloseDocument ( DocH ) オペレーション Close a document and free the memory used by this document.
DocH : The document to delete from memory
DeleteNode ( Node )   Delete a node from the document.
Node : The node to delete
GetAttribute
  ( NodeName
  , AttributeName )
  Try to retreive the value of a node's attribute.
NodeName : The node
AttributeName : The attribute's name
returns : The value of the attribute
GetInnerText ( NodeName )   Return the specified property of the node.
NodeName : The node from which we look for the property
returns : The value of the property.
GetInnerXML ( NodeName )   Return the specified property of the node.
NodeName : The node from which we look for the property
returns : The value of the property.
GetNode   Internal function (not supposed to be called by Small Basic).
remarks : You should not see this function in Small Basic.
GetNodeName
  ( NodeName )
  Return the specified property of the node.
NodeName : The node from which we look for the property
returns : The value of the property
GetNodes
  ( DocumentOrNode
  , XPath )
  Save all the elements matching the XPath query in an array, as native objects.
DocumentOrNode : The document or node from which the search starts
XPath : The XPath query to the nodes
returns : The array containing all matching elements
GetNodeValue
  ( NodeName )
  Return the specified property of the node.
NodeName : The node from which we look for the property
returns : The value of the property
GetOuterXML ( NodeName )   Return the specified property of the node.
NodeName : The node from which we look for the property
returns : The value of the property
InsertCopyOfNode
  ( NewParentNode
  , NodeToCopy , Position )
  Append a new child to an existing node.
NewParentNode : The new parent node
NodeToCopy : The node to add in the new parent node
Position : -1 or the position of the new child in the parent
LoadXMLFile ( FileName )   Create an XML document from a file.
FileName : The location of your XML file
returns : An XML document, as native object
LoadXMLString ( XML )   Create an XML document from a XML string.
XML : A string containing an XML document
returns : An XML document, as a native object.
SaveDocument
  ( DocH , FileName )
  Save an XML document into a file.
DocH : The document, as a native object
FileName : The file where to save the document
returns : "True"/"False"
SetAttribute
  ( NodeName
  , AttributeName
  , AttributeValue )
  Try to set the value of a node's attribute.
NodeName : The node
AttributeName : The attribute's name
AttributeValue : The new value
SetInnerText
  ( NodeName , Value )
  Set the specified property of the node.
NodeName : The node from which we look for the property
Value : The value of the property
SetInnerXML
  ( NodeName )
  Set the specified property of the node.
NodeName : The node from which we look for the property
Value : The value of the property
SetNodeValue
  ( NodeName , Value )
  Set the specified property of the node.
NodeName : The node from which we look for the property
Value : The value of the property

コメントを投稿