Normal Topic Upcoming 1.0.5 SBasic commands (Read 1908 times)
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Upcoming 1.0.5 SBasic commands
Sep 8th, 2004 at 2:48pm
Print Post Print Post  
I can only write an informal (and brief) description of what these do, in that I am not on the Lantica documentation team, and this is something of a preview - but since folks are asking:

Subroutines and Functions new to 1.0.5
======================================

@Application() as string
Returns the current appliction title as it appears on the Menu Tree.

@AsynchShell( command as string ) as int
Just like @Shell, except it doesn't wait. That way you can launch another program and Sesame will keep doing while that program runs.

ClearDefaultTab()
See: SetDefaultTab. This command clears the "default tab".

CloseSlate()
The window that "WriteLn" writes to - is called the "Slate". This command closes it.

@ContractTreeItem( mname as string ) as int
Closes a particular tree item on the command menus.

@Database() as string
Returns the database name to which the current form is bound.

@ExpandTreeItem( mname as string ) as int
Opens or expands a particular tree item on a command menu.

ForceGroupBreak(level as int)
The reports in Sesame 1.0.5 can have additional "nesting" group headers and footers. This allows you to "break" at different "levels" within the group. ForceGroupBreak allows you to use complex conditions to force a break in any of these nesting groups headers/footers. In other words, you can use SBasic conditionals (the "if" statement) to force a group break in a report  on any condition you can think of.

@HideTreeItem( mname as string ) as int
Forces a tree item on a command tree to disappear.

OpenSlate()
The window that WriteLn writes to is called the "Slate". This command will open it if it is not already open.

PopupSelectPosition(p as int, xx as int, yy as int)
This command allows you set where on the screen, window, or form the popup menus (UserSelect, PopupMenu, etc..) appear.

PrintBox(boxtype as int, xpos as int, ypos as int, width as int, height as int)
This command is like PrintString, but prints a box or frame instead of text.

PrintImage(val as string, xpos as int, ypos as int, width as int, height as int)
This command is like PrintString but prints an image instead of text.

@QuestionUser( q as string, def as string ) as string
This is like @AskUser, but instead of using buttons for the choices it uses a text input box - allowing any answer.

@ReLabelTreeItem( mname as string, new_name as string ) as int
This command lets the programmer rename/relabel the command menu tree items.

@RevealTreeItem( mname as string ) as int
This command reveals a tree item previously hidden with HideTreeItem.

@ServerDate() as string
This command returns the date on the server, which might be different than the date on the client.

@ServerTime() as string
This function returns the time of day on the server - which might be different from the time of day on the client.

SetDefaultTab(level as string)
This command lets the programmer set a "tab" that the program will bring to the top when the current tab (form) is closed. That way, when the user hits Escape, the program can always go back to the same form.

@StandAlone() as int
This functions returns true if the current form is running without a parent. It could be used to prevent users from using a subform unless it is embedded in its parent form (or vice-versa).

@Timestamp() as int
This function returns an integer representing the timestamp of the current record - in seconds. This command is useful for generating unique IDs, comparing records, sorting, etc...

@TreeItemExpansion( mname as string ) as int
Returns whether a tree item is expanded or not.

@TreeItemVisibility( mname as string ) as int
Returns whether a tree item is hidden or not.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Upcoming 1.0.5 SBasic commands
Reply #1 - Oct 19th, 2004 at 10:36pm
Print Post Print Post  
Can we get a hint as to how to use @questionuser in a program. I'm anxious to start planning it's use in my programming.

Only if you have time. Otherwise, I'll sit tight for the release and documents.

Thanks,

Steve
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Upcoming 1.0.5 SBasic commands
Reply #2 - Oct 19th, 2004 at 10:58pm
Print Post Print Post  
Hello Steve....try this.......

Quote:
var vName as String
var vIceCream as String
var vDrink as String

vName = @QuestionUser("Enter your first name","")
vIceCream = @QuestionUser("Enter your favorite ice cream flavor","vanilla")
vDrink = @QuestionUser("Enter your favorite soft drink","Diet Coke")

@MsgBox("Hello " + vName,"Your favorite snack is ready", "You will be enjoying " + vIceCream + " ice cream and " + vDrink +".")


Syntax is @QuestionUser("Prompt string to user","Default string to be accepted or overwritten")

Works like @AskUser but allows User Defined strings to be inputted vs. taking a button value.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Upcoming 1.0.5 SBasic commands
Reply #3 - Oct 19th, 2004 at 11:02pm
Print Post Print Post  
Excellent! Thanks Bob!

This will allow me to get rid of a bunch of unbound, 'vacant' LE's on my forms that  were used just to collect user input.

I'll post my Search/Replace program to the examples board when its ready.

Steve
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Upcoming 1.0.5 SBasic commands
Reply #4 - Oct 19th, 2004 at 11:29pm
Print Post Print Post  
Actually, you don't need those unbound fields anyway. 

That is a carryover from Q&A which forced us to do that.  With Sesame you just need to declare some variables.  The variables do not need any LE on your forms.  The same as the sample above, same thing would be done with @AskUser.

Since you are saying the LEs are unbound, then it sounds like you don't need to save the values.  If you don't need to keep the value saved in the database, then don't make an LE, use a variable, like this: 

var vAnswer1 as String
vAnswer1 = @AskUser(.............)

Can do this now in 1.0.4 and all earlier versions.

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Upcoming 1.0.5 SBasic commands
Reply #5 - Oct 20th, 2004 at 1:58am
Print Post Print Post  
Bob, I agree. But Askuser only allows Yes or No. I needed to give our users the ability to enter text that would be used in programming.

Example: there is an unbound number LE with a command button next to it. The user can enter 10 and press the button to run a program that would adjust the selling prices in an Inventory DB by 10% (or 20%, or whatever).

Now, i'll just use QuestionUser to ask the user what percentage they want to use.

Thanks!

Steve
  
Back to top
IP Logged