Normal Topic Newbie Questions (Read 657 times)
Rod Weston
Member
*
Offline



Posts: 25
Joined: Aug 22nd, 2016
Newbie Questions
Aug 23rd, 2016 at 4:40pm
Print Post Print Post  
Evaluating Sesame for use in our company and am quite impressed with what I have seen so far. A couple of questions:
1. I use Notepad++ for coding. Is there an extension I can use that will allow Notepad++ to properly format the coding for me?
2. I am using the example code in the documentation to import a CSV file of zipcodes into a Sesame database, but I want to use 10000 as the starting record ID. I can't tell in the code what it is using as the record ID when it writes the records into the database, but how do I accomplish this?
Thank you for your assistance in advance.

  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Newbie Questions
Reply #1 - Aug 23rd, 2016 at 7:50pm
Print Post Print Post  
As far as notepad++ goes, if you don't want to build your own language definition for SBasic (doesn't look too tough: http://docs.notepad-plus-plus.org/index.php/User_Defined_Languages), you may want to select C/C++. There are a few constructs that lean more toward standard modern BASIC. The built in text editor, while not as powerful as notepad++, does have syntax highlighting for SBasic, and doesn't require quite so much cutting and pasting  Wink.

I'm not sure exactly which bit of sample code from the documentation you are referring to. The ZipCode application itself does not have record IDs (at least my older copy doesn't). Page number?

In general, a unique number can be obtained from @Number() and the starting point can be set in SDesigner for that application, under "Application" see the "Application Property Manager".
  

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



Posts: 25
Joined: Aug 22nd, 2016
Re: Newbie Questions
Reply #2 - Aug 23rd, 2016 at 10:51pm
Print Post Print Post  
I am building a new zipcode application as a test project. I am using the code from "Importing Records Using Programming Only" on page 483. Thanks for the tips.

I'll try using the built-in text editor.

One other question (he says, knowing there will be many, many more...): is there a way to define the default font family and size for Sesame in general or even for just an application? I looked at Sesame.ini but I don't see any controls for the form fonts.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Newbie Questions
Reply #3 - Aug 24th, 2016 at 3:51am
Print Post Print Post  
The example on page 483 of the programming manual also doesn't have a record ID as one of the fields. If you have added a record ID element to your form, you can simply assign it any value you want in the main loop, starting with any value -- such as 10,000. The code below is snipped from the middle of the routine, with one line added to set the RecordID element to 10,000 plus the record counter.

Code
Select All
vFileHandle = fileOpen("C:\Sesame\addresses.txt")
If vFileHandle >= 0
{
  fileSeek(vFileHandle, 0)
  While FilePos(vFileHandle) < FileSize(vFileHandle)
  {
    fileReadLn(vFileHandle, vLine)
    If @Len(vLine) > 20 Then
    {
      parseline()
      nn = @CreateNewRecord()
      Name = t[1]
      Address = t[2]
      City = t[3]
      State = t[4]
      Zip = t[5]

      // This is the line that sets the RecordID to 10,000 plus the running counter
      RecordID = 10000 + counter

      counter = counter + 1
    }
  }
  fileClose(vFileHandle)
  @Msgbox("Imported " + counter + " records.", "", "")
}
 



Just out of curiosity, why do you have a record ID?

Sesame does have default fonts, a couple of which can be set in the sesame.ini file.

MENU FONT: and SECONDARY FONT:

These refer to user interface elements outside of the form. To use a default font on the form, simply set the font you want to use for labels and text, and SDesigner will continue to use that font for all further elements you create until you change them. If you wish to change a font setting that has already been made, select all of the elements you want to change, either by rubberbanding, shift or ctrl select, or using the selection dialog to select by type. etc. and change either the label or text font. It will change all of the selected element's font.

SDesigner has a "set it and forget it" style of editing for all element attributes. You select the attributes that please you for that form, and do not have to reset them again without cause. This maintains a consistent look and feel with a minimum of clicking around.

Under the hood, Sesame selects helvetica/arial font as the starting font. So, if you don't set the font yourself, you start with helvetica. If you have set the font, and want to get back to the settings you had on previous elements, use the make-like-me commands in SDesigner to reset back to a previous setting.
  

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



Posts: 25
Joined: Aug 22nd, 2016
Re: Newbie Questions
Reply #4 - Aug 24th, 2016 at 5:05pm
Print Post Print Post  
Record ID is just a hold-over from a mis-spent database coding past. Thank you for calling me on it. There really is no point in a record ID.

Thanks for the info on form fonts. I'll have to discipline myself to set the font at the beginning of form design. I anticipate moving the forms to html pages anyway, so I can always control the form fonts with css.
  
Back to top
 
IP Logged