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 unsubscribe from this group and stop receiving emails from it, send an email to
semware+u...@googlegroups.com.
> 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.