Page Index Toggle Pages: 1 ... 3 4 [5] 6 7  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Sesame 3 Feature Requests (Read 26789 times)
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame 3 Feature Requests
Reply #60 - Nov 2nd, 2011 at 7:13pm
Print Post Print Post  
Bharat_Naik wrote on Nov 2nd, 2011 at 6:38pm:
Quote:
@Calendar ( ) is a sBasic popup, just like @PopupMenu ( ) and @PopupChoiceList (). But as far as I know, @Calendar ( ) does not take the position just as opposed to the other two with @SelectPopUpPosition ( ) command. Can we have @Calendar () respect and obey @SelectPopUPPosition ( ) command?


Any thoughts on this?


Considering... Ok, done.
  

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



Posts: 243
Joined: Jan 29th, 2010
Re: Sesame 3 Feature Requests
Reply #61 - Nov 12th, 2011 at 3:11pm
Print Post Print Post  
Any chance of a two-pass compiler or similar approach?

I generally like to lay out programs in this sequence, which doesn't work with a one-pass compiler:

// Start by defining high-level activities, then define the sub-sections later.

// Setup info, get initial input, etc.

Call SetVars
Call GetInitialInput
Call ProcessData
Call PrepareOutput
Call Cleanup
Exit


==================
procedure/function1 // e.g., define variables
end proc/func

Proc/Func2
end proc/func2

Proc/Func3
end proc/func3

====================

As an alternative, WordPerfect Macro Language (which is a full-featured structured programing language) has a "Procedure Prototype" command.  Near the top you just specify the name of the procedure or function and the parameters and return value type.  That way the compiler knows what to expect, so it doesn't give an "undefined procedure/function" error when compiling.

Let's say you had a "DoubleInput" function:


Function Prototype DoubleInput(NumVal as Binary) as Binary

... Rest of the main program ...

Function DoubleInput(NumVal as Binary) as Binary
       Return 2 * NumVal
End Function

========================

One advantage of the Prototype approach is it gives you a neat "table of contents" of procedures and functions near the top, since the prototype definition should only take one line.
  
Back to top
 
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: Sesame 3 Feature Requests
Reply #62 - Nov 12th, 2011 at 3:12pm
Print Post Print Post  
One of the following (or both and the programmer gets to set which one):

1) End subroutine, End procedure and End Function require the subroutine/procedure/function name.

This makes it easier to figure out where you are in a long program, particularly with s/p/f's that span more than one page.

2) If a line begins with End subroutine, End procedure, or End function, everything after that is ignored.

This would allow "End Procedure MyProc" without needing to have MyProc commented out.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame 3 Feature Requests
Reply #63 - Nov 13th, 2011 at 5:06am
Print Post Print Post  
Rick_R wrote on Nov 12th, 2011 at 3:12pm:
One of the following (or both and the programmer gets to set which one):

1) End subroutine, End procedure and End Function require the subroutine/procedure/function name.

This makes it easier to figure out where you are in a long program, particularly with s/p/f's that span more than one page.

2) If a line begins with End subroutine, End procedure, or End function, everything after that is ignored.

This would allow "End Procedure MyProc" without needing to have MyProc commented out.


You can, of course, follow the "end subroutine" or "end function" statements with a comment on the same line.

Code
Select All
function my_func()
   do_stuff()
   do_more_stuff()
end function // my_func()
 



If you are otherwise losing the end of your subroutines or functions, I'd recommend very careful indenting, where the content of every routine is indented a consistent amount, as well as the content of each conditional. The examples in K&R use the following three formats. It is wise to pick one and use it consistently (I prefer the first):
Code
Select All
   if(name = "john")
   {
      do_something()   
   }
 


Code
Select All
   if(name = "john") {
      do_something()   
   }
 


Code
Select All
   if(name = "john")
      {
      do_something()   
      }
 


If the problem is merely the length of a routine, repartitioning your code into smaller routines is strongly recommended. Unless there is a functional imperative toward a contiguous routine (like a conditional with many "else if" conditions), I'd generally recommend that no routine ever exceed 30 lines of code, with only one full statement per line.

There is a no functional advantage in SBasic to resort to code packing.
  

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



Posts: 243
Joined: Jan 29th, 2010
Re: Sesame 3 Feature Requests
Reply #64 - Nov 18th, 2011 at 11:50pm
Print Post Print Post  
In-line If:

x = iif(a > b, ValIfTrue, ValIfFalse)

I have set up a bunch of functions like that but it requires one for IfDate ..., another for IfString ..., etc. The languages I have seen with an iif function automatically determine the data type and return the correct type. Of course, you can't use x = iif( comparison, IntegerIfTrue, DateIfFalse)
  
Back to top
 
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: Sesame 3 Feature Requests
Reply #65 - Nov 19th, 2011 at 12:02am
Print Post Print Post  
In-line select:

x = Select(position, Val_1, Val_2, Val_3 ...)

"Position" would have to evaluate to a number. I think the most I have seen for these is around 10 choices. I would think a minimum of 7 (for days of the week) up to possibly 12 (for months).  Like in-line if, one function could be used regardless of the data type being returned.

For instance:

Gender = Select(Position, "Male", "Female", "Unknown", "Multiple")

The last one isn't a joke.  In veterinary medicine the "gender" of a litter is "multiple".

And the Swahili language has six genders including "rock" and "knife", but we won't get into that ...


(... Since I know everyone will ask  Smiley ... In grammar, "gender" means "type".  The "rock" "gender" means words that take the same grammatical forms that the word "rock" uses, etc. English is one of only a few languages where the gender of a noun is normally the same as the gender of the actual item.)
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame 3 Feature Requests
Reply #66 - Nov 19th, 2011 at 5:39am
Print Post Print Post  
Code
Select All
Gender = @AccessStringArray("Male;Female;Unknown;Multiple", position)
 


if you are fond of term "select", you could:
Code
Select All
#define @select @AccessStringArray

var aa as int

aa = @select("1;2;3;4", 3)
writeln(aa)
 



...or use an array:
Code
Select All
var aa as array[3] of string

aa[1] = "Girl"
aa[2] = "Boy"
aa[3] = "Undetermined"

bb = aa[position]
 


  

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



Posts: 243
Joined: Jan 29th, 2010
Re: Sesame 3 Feature Requests
Reply #67 - Nov 19th, 2011 at 8:02am
Print Post Print Post  
The purpose of in-line select (or, alternatively, "case" or "switch", depending on the language) and in-line if is to avoid having to write custom procedures, create arrays, etc., where you simply want to say "Based on the contents of this variable (or logical evaluation), return this value." For instance, say you wanted to return the name of the day in Spanish.  Yes, you could write an array, or a multi-line If comparison, etc., but it would be a lot easier to just have DayName = Select(DOW, "Domingo", "Lunes", "Martes", "Miercoles", etc.)

As I mentioned, I have written a set of "in-line if" functions, but it requires a separate one for each data type:

     IifStr() String -  in-line if returns first string if condition is true, else second

     IifChar() Char - in-line if returns first character if condition is true, else second (etc.)
     IifDate()
     IifTime()
     IifInt()
     IifDouble()
     IifMoney()

FoxPro has both and it makes programming much easier.  Often something can be done with a single line of code interactively that requires an entire subroutine in most other languages--often just because they lack an in-line if or an in-line select function, so a full-blown CASE A ... CASE B ... DEFAULT ... END CASE structure has to be used.

Whether it is in-line if or in-line select, they shouldn't be just for strings, e.g., Bonus = Select(YearsOfService, 200, 500, 1000, 1500) or whatever.

... And for that example, you would probably want to nest an in-line if so that:

Bonus = Select(iif(YearsOfService < 4, YearsOfService, 4), 200, 500, 1000, 1500)
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Sesame 3 Feature Requests
Reply #68 - Nov 19th, 2011 at 2:27pm
Print Post Print Post  
We understand what these constructs are for, Rick. We do speak a programming language or two around here.   Wink

Mark was just letting you know that you do have some current options, if this is something you need in Sesame 2.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Sesame 3 Feature Requests
Reply #69 - Nov 19th, 2011 at 5:37pm
Print Post Print Post  
Hammer wrote on Nov 19th, 2011 at 2:27pm:
We do speak a programming language or two around here.   Wink


That's funny.  You all speak lots of languages.

Back in the dark ages when I was young my parents asked a school counselor if I should be taking a foreign language,

They said "your sons English is a foreign language". Heck I was from Brooklyn!
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Sesame 3 Feature Requests
Reply #70 - Nov 27th, 2011 at 2:49am
Print Post Print Post  
Is there anyway, we can make the Element and/or Label to blink using sBasic to draw the user's attention as required in Sesame3? Is it possible to do the name in Sesame2.xx without using RunEntryOnInterval ( )?
  
Back to top
 
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: Sesame 3 Feature Requests
Reply #71 - Dec 30th, 2011 at 3:36pm
Print Post Print Post  
Two things;

1.      When running a Quick Report, how about an option to print row and column lines like a spread sheet, when desired, along with the capability to select the color of the lines.

2.      When you press the Delete Record button you currently receive these warnings, “Do you want to permanently delete this [form name] record?” Or, “Do you want to permanently delete this SUBFORM [form name] record?”  Could it be enhanced to include PARENT [form name] record & TAB PAGE [form name] record” - and also have PARENT, SUBFORM and TAB PAGE show in different bolded colors?
  
Back to top
IP Logged
 
laurie
Member
*
Offline



Posts: 27
Joined: Feb 18th, 2011
Re: Sesame 3 Feature Requests
Reply #72 - Jan 5th, 2012 at 10:30pm
Print Post Print Post  
how about the ability to copy records from one database to another like we could in q&a.  i run a vending company and would have 2 seperate databases one with current customers and then when customer cancelled would then copy the info to a inactive database then i would delete from the current database.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Sesame 3 Feature Requests
Reply #73 - Jan 5th, 2012 at 10:36pm
Print Post Print Post  
laurie wrote on Jan 5th, 2012 at 10:30pm:
how about the ability to copy records from one database to another like we could in q&a.  i run a vending company and would have 2 seperate databases one with current customers and then when customer cancelled would then copy the info to a inactive database then i would delete from the current database.


You can copy records between two databases in the same application. To copy to a different application, export from one and import into the other.

In general though, to avoid having the two applications get out of synch with one another, we tend to put a checkbox on the form for Active and uncheck it to make a client inactive. This keeps the records in synch and provides more flexibility with reports. Just my 2 cents.  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
laurie
Member
*
Offline



Posts: 27
Joined: Feb 18th, 2011
Re: Sesame 3 Feature Requests
Reply #74 - Jan 5th, 2012 at 10:58pm
Print Post Print Post  
i dont do reports of the customer information but what i do is reuse the account numbers. 

will look into the export/import my needs are very small regarding what i need to do and sesame is so much more then q&a
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 ... 3 4 [5] 6 7 
Send Topic Send Topic Print Print