It works just as it would if Notes was selected from the Top Level Menu even with password projected Notepads.
The Technical Reference Manual suggests you 'do not search the main menu for "NOTES" and its address, as its name changes in multi-lingual versions.' With this in mind the routine looks for 'NOTES' English, French and Italian, 'NOTIZ' German, 'NOTAS' Spanish and 'NOTER' Danish.
You can easily adapt this routine to launch any MENU Item by changing IF CH%= to the number of characters in the menu item you are searching for and changing the IF L4$="NOTES" OR L4$="NOTIZ" OR L4$="NOTAS" OR L4$="NOTER" to the different language options of the item you are looking for.
I've call it OpnNotes: you can call it what suits you best.
Code: Select all
OPNNOTES:
LOCAL CH%,AD%,LP%,L4$(5)
REM Modified from Organized Solutions TIMERTN.OPL
REM Martin Reid - January 2024
REM Examines Top Level Menu for NOTES than calls it
REM CH%=Number of Characters in Menu Item
REM AD%=PEEKS Menu Address
REM LP%=LOOP 1 to 6
REM L4$=Stores Menu Item for comparison (5 Characters)
AD%=PEEKW(8194) :REM (9869) $2002 Top Level Menu
CURSOR OFF
DO
CH%=PEEKB(AD%) :REM 9869=4 ETC..
IF CH%=0
RETURN 1 :REM IF 1 then not found
ENDIF
IF CH%=5 :REM 5 letter menu items
L4$=""
LP%=1
DO
L4$=L4$+CHR$(PEEKB(AD%+LP%))
LP%=LP%+1
UNTIL LP%=6
IF L4$="NOTES" OR L4$="NOTIZ" OR L4$="NOTAS" OR L4$="NOTER"
USR(PEEKW(AD%+CH%+1),0)
CLS
RETURN
ENDIF
ENDIF
AD%=AD%+CH%+3 :REM eg.. 9869+4+3 = 9876
UNTIL 0 :REM Careful infinate loop
Code: Select all
CHK:
LOCAL M%
DO
PRINT "Test menu call"
M%=MENUN(2,"QUIT,NOTES,DIARY")
IF M%=1 :PRINT "QUIT"
ELSEIF M%=2 :OpnNotes:
ELSEIF M%=3 :REM another item
ENDIF
UNTIL M%<=1
Without exiting your program which might mean closing files ext; It might useful to be able to use Notes, Diary, Utils (Dir, Info etc..) even xFiles as long as you remember to close any files before you go there to work on them.
Sincerely
Martin
PS I'd be interested to hear from anyone that tries it..