Let me reiterate that this TPC is not a complete item, and is merely a beta test for the “proof of concept” of an Input Console, but more importantly is to test integrity of the dll that is produced by ZK’s converter application.
Download TPC:
http://www.mod2software.com/misc/inputconsole_exp.zip
Description:
The InputConsole is simply a data holding object that allows you to input and alter variable values in your DBP application from outside of the DBP application at runtime. You can manipulate data values from your DBP code as well as from the InputConsole’s UI. Currently 4 major DBP data types are supported: Integer, String, DWord, and Float (the correlating vb.net types are Integer, Uint32, Uint32, and Single) There is a 100-elemnt Object array held in the dll for your values. Any of the 4 value types can be stored in any of the 100 elements. All elements are initialized with 0 (zero) as type Object (VB.NET base class, inherited by all other objects regardless of extended type) for their value. Element Indexes are zero based (0-99). Providing an index argument outside of this range (0-99) will produce an error and crash.
Setup:
Copy the file InputConsole_EXP.dll to your plugins-user directory like you would any other TPC. No wrapper dll is required in the exe dir
Usage from DBP Code:
Below is a function listing, any required arguments for each, and a brief description of the function/method itself.
Public Shared Function IC_Init() As Integer
You must call this function prior to any others. It initializes the component for use. Returns 1 on success, 0 on fail (as integer)
Public Shared Sub IC_ResetValues()
Call this method at any time to reset all 100 elements of the Object array to 0 (zero)
Public Shared Sub IC_Show()
Call this method at any time to display the InputConsole’s UI
Public Shared Sub IC_Hide()
Call this method at any time to hide the InputConsole’s UI
GET FUNCTIONS – RETRIEVE DATA FROM INPUT CONSOLE
Public Shared Function IC_GetValueAsString(ByVal OldStr As UInt32, ByVal index As Integer) As UInt32
Call this function to return a string held in the IC. Please note that you need only pass in the Index value of the item to retrieve. OldStr argument is used behind the scenes by DBP and does not need to be provided by the user. Your call from DBP should look like: myString=IC_GetValueAsString(Index)
Public Shared Function IC_GetValueAsInteger(ByVal index As Integer) As Integer
Call this function to return an Integer held in the IC, providing the index of the element to return (0-99)
Public Shared Function IC_GetValueAsFloat(ByVal index As Integer) As Single
Call this function to return an Float held in the IC, providing the index of the element to return (0-99)
Public Shared Function IC_GetValueAsDword(ByVal index As Integer) As UInt32
Call this function to return a Dword held in the IC, providing the index of the element to return (0-99)
SET FUNCTION – SETTING ELEMENTS OF THE IC WITH VALUES
Public Shared Sub IC_SetValueAsString(ByVal index As Integer, ByVal sValue As String)
Use this method to set an element with a String value by providing the index value (0-99), and the string to set.
Public Shared Sub IC_SetValueAsInteger(ByVal index As Integer, ByVal iValue As Integer)
Use this method to set an element with an Integer value by providing the index value (0-99), and the integer to set.
Public Shared Sub IC_SetValueAsFloat(ByVal index As Integer, ByVal fValue As Single)
Use this method to set an element with a Float value by providing the index value (0-99), and the float to set.
Public Shared Sub IC_SetValueAsDword(ByVal index As Integer, ByVal dValue As UInt32)
Use this method to set an element with a Dword value by providing the index value (0-99), and the dword to set.
OTHER TEST FUNCTIONS THAT RETURN STRINGS
Public Shared Function IC_str_Mid(ByVal OldStr As UInt32, _
ByVal Str As String, _
ByVal Start As Integer, _
ByVal Length As Integer) As UInt32
A simple string Mid function that returns a substring of the passed in string. Provide the 1-based start character, and length of the substring to return. (Again, ignore OldStr argument, this is used by DBP behind the scenes.)
DBP Example: myString= IC_str_Mid(“Hello”,2,3)
myString would yield: “ell”
Public Shared Function IC_Now(ByVal OldStr As UInt32) As UInt32
No arguments required. Returns the date and time (in your system’s format) as a string.
DBP Example: myString=IC_Now()
myString would yield: “6/13/2005 10:15:00” or equivalent based on your region and system settings.
USAGE FROM INPUTCONSOLE UI
Select any element in the list and type a value for it in the text field. Press the button to set the value for the selected element. The value for that element will immediately change. Any var in DBP that is pointing to this element will receive the new value. Be careful to not mix and match types for a particular element or you may produce a DBP error. Use the reset button at any time to clear and reset the IC array elements.
DBP SAMPLE CODE:
Just a simple example of how to call the Input Console. Hopefully anyone beta testing will think of more clever things to try
global iInit as integer
global sTest as string
global iLoops as integer
iinit=IC_INIT()
set cursor 0,0
print str$(iinit)
IC_Show
ic_setvalueasstring 0,"hello world"
do
iloops=iloops+1
sTest=ic_getvalueasstring(0)
set cursor 0,0
print "Loops:" + str$(iLoops)
set cursor 0,15
print "String:" + sTest
set cursor 0,30
print "Mid:" + ic_str_mid(sTest,2,3)
set cursor 0,45
print "Now:" + ic_now()
wait 250
cls
if controlkey()=1
end
endif
if spacekey()=1
IC_ResetValues
endif
loop
Please post in this thread if you can beta test the TPC and please describe and problems you may have encountered, in as much detail as possible. ZKAT8IT, APEXnow, and myself will be available to help.
Thanks in advance for the testing!
DBP - AirAmericaRadio.com - MoveOn.org - The news has been cancelled!