Creating picklists

3 views
Skip to first unread message

Fred H Olson

unread,
Dec 18, 2020, 9:55:57 AM12/18/20
to Semware
TSE uses lots of picklists but I dont have not found any thing about
creating them in general. It very doable but, I dont want to reinvent
the wheel. A template / simple example would be nice.

Any suggestions?

Fred


--
Fred H. Olson Minneapolis,MN 55411 USA (near north Mpls)
Email: fholson at cohousing.org 612-588-9532
My Link Pg: http://fholson.cohousing.org

knud van eeden

unread,
Dec 18, 2020, 11:24:37 AM12/18/20
to Semware
PickFile
========



Allows the user to select a file from a list and returns the filename.

Syntax:     STRING PickFile(STRING fn [, INTEGER flags])

            - fn is a string that may include wildcards to specify files to
              include in the PickList.  It may also include a specific drive
              and/or directory.  If these are omitted from the string, the
              current drive and/or directory are used.

            - flags is optional.  Supported values for flags are:

              - _INSERT_PATH_ causes PickFile() to insert the entire path,
                rather than just the name of the file.

              - _SEARCH_SUBDIRS_ causes PickFile() to also search any
                subdirectories that are under the current search path.

Returns:    The selected filename (including full path), or a zero-length
            string if <Escape> was pressed.

Notes:      If fn is the name of a directory or of a filename containing
            wildcard characters, a list of all matching files is presented
            for selection.

            This is the same PickList used in the built-in EditFile()
            command.

See Also:   EditFile(), EditThisFile(), PickDrive()

            Variables: PickFileFlags, PickFileSortOrder

with friendly greetings
Knud van Eeden

--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

knud van eeden

unread,
Dec 18, 2020, 11:26:44 AM12/18/20
to Semware
Simplest example:

PROC Main()
 Warn( PickFile( "c:\temp\" ) )
END


Fred H Olson

unread,
Dec 18, 2020, 2:34:25 PM12/18/20
to 'knud van eeden' via SemWare TSE Pro text editor
Thanks Knud.

With my search for "picklist" I did not see pickfile()" .
That will work nicely for my current need of picking a binary file
to be opened by another program.

It would be nice to have something more general like

integer Picklist(bufferid,[options]) where bufferid has an arbitrary list
that returns line number of list item picked.

It's nice that Pickfile() does not have the limit that Menu() does
of the number of lines having to fit in the window (it scrolls).
Other than that menu() is very flexible but (I think) the list of items
has to be defined at compile time. And of course it is designed to execute
a function which would be hard to specify except at compile time...

Fred


On Fri, 18 Dec 2020, 'knud van eeden' via SemWare TSE Pro text editor wrote:

> Simplest example:
> PROC Main() Warn( PickFile( "c:\temp\" ) )END
>
> On Friday, December 18, 2020, 05:24:31 PM GMT+1, knud van eeden <knud_va...@yahoo.com> wrote:
>
> PickFile========
>
>
> Allows the user to select a file from a list and returns the filename.
> Syntax:     STRING PickFile(STRING fn [, INTEGER flags])
>             - fn is a string that may include wildcards to specify files to              include in the PickList.  It may also include a specific drive              and/or directory.  If these are omitted from the string, the              current drive and/or directory are used.
>             - flags is optional.  Supported values for flags are:
>               - _INSERT_PATH_ causes PickFile() to insert the entire path,                rather than just the name of the file.
>               - _SEARCH_SUBDIRS_ causes PickFile() to also search any                subdirectories that are under the current search path.
> Returns:    The selected filename (including full path), or a zero-length            string if <Escape> was pressed.
> Notes:      If fn is the name of a directory or of a filename containing            wildcard characters, a list of all matching files is presented            for selection.
>             This is the same PickList used in the built-in EditFile()            command.
> See Also:   EditFile(), EditThisFile(), PickDrive()
>             Variables: PickFileFlags, PickFileSortOrder
> with friendly greetingsKnud van Eeden
> On Friday, December 18, 2020, 04:01:57 PM GMT+1, Fred H Olson <fho...@cohousing.org> wrote:
>
> TSE uses lots of picklists but I dont have not found any thing about
> creating them in general. It very doable but, I dont want to reinvent
> the wheel.  A template / simple example would be nice.
>
> Any suggestions?
>
> Fred
>
>
> --
> Fred H. Olson  Minneapolis,MN 55411  USA        (near north Mpls)
>     Email:        fholson at cohousing.org      612-588-9532
> My Link Pg: http://fholson.cohousing.org
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/semware/1105133541.1288875.1608308799301%40mail.yahoo.com.

knud van eeden

unread,
Dec 18, 2020, 3:23:26 PM12/18/20
to 'knud van eeden' via SemWare TSE Pro text editor
> integer Picklist(bufferid,[options]) where bufferid has an arbitrary list
that returns line number of list item picked.

That I use all the time in many of my programs, it is great. 

It is 

List()

or 

similar LList()

See also TSE help.

You can e.g. load the items from an external file, or even more transparent run a macro which
fills the list by loading an external file with lines, then run List()

Example:
---

 PROC Main()
  //
  STRING s[255] = ""
  //
  PushPosition()
  //
  EditFile( "YourTemporaryFile" ) 
  //
  AddLine( "Option 1" )
  AddLine( "Option 2" )
  AddLine( "Option 3" )
  AddLine( "Option 4" )
  //
  IF Llist( "<Your window title>", 20, 22, _ENABLE_SEARCH_ + _ANCHOR_SEARCH_ + _ENABLE_HSCROLL_ )
   //
   s = GetText( 1, 255 )
   Warn( s )
   //
  ENDIF
  //
  AbandonFile()
  //
  PopPosition()
  //
 END

===


> To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/semware/alpine.DEB.2.20.2012180851490.4904%40web15.tigertech.net.
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

>

--
Fred H. Olson  Minneapolis,MN 55411  USA        (near north Mpls)
    Email:        fholson at cohousing.org      612-588-9532
My Link Pg: http://fholson.cohousing.org

--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/semware/alpine.DEB.2.20.2012181313020.4904%40web15.tigertech.net.

knud van eeden

unread,
Dec 18, 2020, 4:01:32 PM12/18/20
to 'knud van eeden' via SemWare TSE Pro text editor
A simplest example of List()

 PROC Main()
  STRING s[255] = ""
  INTEGER bufferI = 0
  PushPosition()
  PushPosition()
   bufferI = CreateTempBuffer()
  PopPosition()
  GotoBufferId( bufferI )
  AddLine( "Option 1" )
  AddLine( "Option 2" )
  AddLine( "Option 3" )
  AddLine( "Option 4" )
  IF List( "<Your window title>", 80 )
   s = GetText( 1, 255 )
   // Warn( "line number is now", " ", CurrLine() )
  ENDIF
  AbandonFile( bufferI )
  CASE s
   WHEN "Option 1"
    Warn( "Option 1" )
   WHEN "Option 2"
    Warn( "Option 2" )
   WHEN "Option 3"
    Warn( "Option 3" )
   WHEN "Option 4"
    Warn( "Option 4" )
   OTHERWISE
    Warn( s, ":", " ", "not known. Please check." )
  ENDCASE
  PopPosition()
 END


Fred H Olson

unread,
Dec 18, 2020, 4:52:44 PM12/18/20
to 'knud van eeden' via SemWare TSE Pro text editor
Thanks, I did not remember that either. I've added to my notes:
creating picklists see pickfile() and list()
and Dec 18/20 email on semware@googlegroup

I modified your example to make a longer list. I dropped the "OTHERWISE"
warning and whole case actually. I dont see how it could happen.

PROC Main()
INTEGER bufferI = 0,i
PushPosition()
PushPosition()
bufferI = CreateTempBuffer()
PopPosition()
GotoBufferId( bufferI )
for i = 1 to 30
AddLine( "Option "+ str(i))
endfor
IF List( "<Your window title>", 80 )
Warn( "line number is now", " ", CurrLine() )
ENDIF
AbandonFile( bufferI )
PopPosition()
END
<f7> main()



BTW I use a text based email program (Alpine) (with TSE as the editor to
compose mail. The example macros in the body of your message come out for me
as one long line. To get the lines back I saved the html version of your
messages and looked at it with a browser and copy pasted the macro to TSE...

Fred

On Fri, 18 Dec 2020, 'knud van eeden' via SemWare TSE Pro text editor wrote:

> A simplest example of List()
>  PROC Main()  STRING s[255] = ""  INTEGER bufferI = 0  PushPosition()  PushPosition()   bufferI = CreateTempBuffer()  PopPosition()  GotoBufferId( bufferI )  AddLine( "Option 1" )  AddLine( "Option 2" )  AddLine( "Option 3" )  AddLine( "Option 4" )  IF List( "<Your window title>", 80 )   s = GetText( 1, 255 )   // Warn( "line number is now", " ", CurrLine() )  ENDIF  AbandonFile( bufferI )  CASE s   WHEN "Option 1"    Warn( "Option 1" )   WHEN "Option 2"    Warn( "Option 2" )   WHEN "Option 3"    Warn( "Option 3" )   WHEN "Option 4"    Warn( "Option 4" )   OTHERWISE    Warn( s, ":", " ", "not known. Please check." )  ENDCASE  PopPosition() END
>
> On Friday, December 18, 2020, 09:23:20 PM GMT+1, knud van eeden <knud_va...@yahoo.com> wrote:
>
> > integer Picklist(bufferid,[options]) where bufferid has an arbitrary list
> that returns line number of list item picked.
>
> That I use all the time in many of my programs, it is great. 
> It is 
> List()
> or 
> similar LList()
> See also TSE help.
> You can e.g. load the items from an external file, or even more transparent run a macro whichfills the list by loading an external file with lines, then run List()
> > To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/semware/alpine.DEB.2.20.2012180851490.4904%40web15.tigertech.net.
> >
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/semware/1105133541.1288875.1608308799301%40mail.yahoo.com.
> >
>
> --
> Fred H. Olson  Minneapolis,MN 55411  USA        (near north Mpls)
>     Email:        fholson at cohousing.org      612-588-9532
> My Link Pg: http://fholson.cohousing.org
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/semware/1417693494.1539923.1608325289177%40mail.yahoo.com.

michae...@verizon.net

unread,
Dec 18, 2020, 5:12:25 PM12/18/20
to sem...@googlegroups.com
Hello,
I haven’t used tse in 20 years  I have version 4.4.  How can I recompile 300+ macros from a dos command line?

Thanks,

> > To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

> > To view this discussion on the web visit https://groups.google.com/d/msgid/semware/alpine.DEB.2.20.2012180851490.4904%40web15.tigertech.net.
> >
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

> > To view this discussion on the web visit https://groups.google.com/d/msgid/semware/1105133541.1288875.1608308799301%40mail.yahoo.com.
> >
>
> --
> Fred H. Olson  Minneapolis,MN 55411  USA        (near north Mpls)
>     Email:        fholson at cohousing.org      612-588-9532
> My Link Pg: http://fholson.cohousing.org
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/semware/alpine.DEB.2.20.2012181313020.4904%40web15.tigertech.net.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

>

--
Fred H. Olson  Minneapolis,MN 55411  USA        (near north Mpls)
    Email:        fholson at cohousing.org      612-588-9532
My Link Pg: http://fholson.cohousing.org

--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/semware/alpine.DEB.2.20.2012181542120.4904%40web15.tigertech.net.

knud van eeden

unread,
Dec 18, 2020, 5:20:09 PM12/18/20
to 'knud van eeden' via SemWare TSE Pro text editor
> I modified your example to make a longer list. I dropped the "OTHERWISE"
warning and whole case actually.  I dont see how it could happen.

That is an example of a 'sentinel' method. 

That is it is like a 'guard' located at the end of the checking line that checks for any unknown entries and warns about it.
Depending on the application it might be handy.
E.g. you load lines out of a given file to do something (e.g. 100 natural languages to choose from, like Russian, Chinese, ... which you load into that List() buffer.
Then you choose your option in the List() and after that handle it typically using that CASE ... ENDCASE.
But maybe there is then a language, like French, which you can choose from the List(), but is not  handled
by you already in your CASE...ENDCASE. In that case our 'sentinel' guard flags it and gives you a warning.
=> He, do something programmer and add it ;-)

---

> BTW I use a text based email program (Alpine) (with TSE as the editor to
compose mail.  The example macros in the body of your message come out for me
as one long line.  To get the lines back I saved the html version of your
messages and looked at it with a browser and copy pasted the macro to TSE...

Yes, well I create sometimes (TSE) knowledge base articles which I also publish and which circumvent these issues and were specially used for that (e.g. very long single lines are covered correctly), as it is HTML there, but now thus for TSE in general quick email based responses copy/paste where I see fit for which I use my browser as an email client. It has clearly its format disadvantages.

===

> > To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

> > To view this discussion on the web visit https://groups.google.com/d/msgid/semware/alpine.DEB.2.20.2012180851490.4904%40web15.tigertech.net.
> >
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

> > To view this discussion on the web visit https://groups.google.com/d/msgid/semware/1105133541.1288875.1608308799301%40mail.yahoo.com.
> >
>
> --
> Fred H. Olson  Minneapolis,MN 55411  USA        (near north Mpls)
>     Email:        fholson at cohousing.org      612-588-9532
> My Link Pg: http://fholson.cohousing.org
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/semware/alpine.DEB.2.20.2012181313020.4904%40web15.tigertech.net.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

>

--
Fred H. Olson  Minneapolis,MN 55411  USA        (near north Mpls)
    Email:        fholson at cohousing.org      612-588-9532
My Link Pg: http://fholson.cohousing.org

--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/semware/alpine.DEB.2.20.2012181542120.4904%40web15.tigertech.net.

knud van eeden

unread,
Dec 18, 2020, 5:25:17 PM12/18/20
to sem...@googlegroups.com
           cd <your directory>

           sc32.exe *.s


note: in <your directory> you have 1 or more of your .s files located.

note: adapt the filepath so that it points to your sc32.exe and it can be found.

with friendly greetings
Knud van Eeden

To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/semware/570493246.2343640.1608329537473%40mail.yahoo.com.

knud van eeden

unread,
Dec 18, 2020, 5:30:50 PM12/18/20
to sem...@googlegroups.com
note: FYI: sc32.exe means 'S'emware'C'ompiler32bits

michae...@verizon.net

unread,
Dec 18, 2020, 5:39:54 PM12/18/20
to sem...@googlegroups.com

michae...@verizon.net

unread,
Dec 18, 2020, 10:27:56 PM12/18/20
to sem...@googlegroups.com
Thank you so much. I actually had 550 macros I wrote in 25 years. They all recompiled in 2 minutes. 
Thank you all so much.  

Carlo

unread,
Dec 18, 2020, 11:15:49 PM12/18/20
to sem...@googlegroups.com

To add to Knud's excellent point:
https://ecarlo.nl/tse/index.html#elist
This list lets you type any part of the filename to reduce the list to those names that match.



Reply all
Reply to author
Forward
0 new messages