Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 30th April 2008, 11:49
AndreasSchmitt's Avatar
AndreasSchmitt AndreasSchmitt is offline
Junior Member
 
Join Date: May 2003
Posts: 11
AndreasSchmitt is on a distinguished road
Baan: BaanIVc4 - DB: Oracle 8.1.7 - OS: Solaris 8
Question 3GL ASCII-Menu System for ERP-LN
Baan: ERP LN 6.1
C/S: Server

I'm trying to develop an ASCII Menu System for ERP-LN to start 3GL sessions from it. We are using a lot of telnet based WLAN Scan-Devices running BaanIV-3GL session. What we are missing in LN is the good old menu system.
I've developed a 3GL ASCII-Session implememting a menu - works fine !
From the menu I can start various sessions via activate("Programm.Name") but I have to close the called session if I want to get back to the menu. Task switching - via hot key - between running 3GL sessions is no possible.
Is anybody out there who kows how to work with this program groups for event handling and the other stuff for parallelizing the sessions?

Many thanks in advance for any response ...
Reply With Quote
  #2  
Old 30th April 2008, 11:55
dharam.dv dharam.dv is offline
Member
 
Join Date: Jul 2007
Posts: 56
dharam.dv is on a distinguished road
Baan: LN 6.1 - DB: SQL - OS: Windows,unix
Can you send the code of it.

Regards
Dharam
Reply With Quote
  #3  
Old 30th April 2008, 13:10
AndreasSchmitt's Avatar
AndreasSchmitt AndreasSchmitt is offline
Junior Member
 
Join Date: May 2003
Posts: 11
AndreasSchmitt is on a distinguished road
Baan: BaanIVc4 - DB: Oracle 8.1.7 - OS: Solaris 8
Post

The menu is still very experimental, only 1 program is called when you press <return> but for testing purposes this should be enough !


|******************************************************************************
|* tccom9000 0 VRC B61C a echt
|* Menusystem for 3GL Sessions - Still very experimental
|* as
|* 29.04.08 [11:09]
|******************************************************************************
|* Script Type: 0
|******************************************************************************

#ident "@(#)tccom9000 tcB61Caecht s1erp3 Rev.No. 2 29 Apr 08 AS"

#include <bic_tt>
#include <bic_dam>
|/ #include "itcmcs2000" |* DAL(-GUI) Support Defines

long event(EVTMAXSIZE)
long menu.win
long sub.win
long sub.pid
long px
long py
long prog.run
long num.key
long i
long me
long last.menu.cursor

#define FIRSTMENU 3
#define MAXMENU 12
long LASTMENU


STRING menu.entries(16,MAXMENU) |/ 10 Strings of length 16
STRING menu.keys(1,MAXMENU)

function main()
{
prog.run = 1

|/ Menu should be placed into a database table ...

menu.entries(1,1) = "Programm 1"
menu.entries(1,2) = "Programm 2"
menu.entries(1,3) = "Programm 3"
menu.entries(1,4) = "Programm 4"
menu.entries(1,5) = "Programm 5"
menu.entries(1,6) = "Programm 6"
menu.entries(1,7) = "Programm 7"
menu.entries(1,8) = "Programm 8"
menu.entries(1,9) = "Programm 9"
menu.entries(1,10) = "Programm 10"

menu.keys(1,1) = "1"
menu.keys(1,2) = "2"
menu.keys(1,3) = "3"
menu.keys(1,4) = "4"
menu.keys(1,5) = "5"
menu.keys(1,6) = "6"
menu.keys(1,7) = "7"
menu.keys(1,8) = "a"
menu.keys(1,9) = "x"
menu.keys(1,10) = "z"

menu.win = new.window(16, 20, 1, 1)

px = 2
py = 2

display.empty.form()

for i=1 to 10 step 1
print cp$(px,py+i), "(" & menu.keys(1,i) & ") " & menu.entries(1,i)
LASTMENU = py+i
endfor
refresh()

last.menu.cursor = FIRSTMENU
menu.cursor(FIRSTMENU)

px = 10
py = 16
print cp$(px,py), " "
refresh()

while( prog.run = 1)
next.event(event)

on case evt.type(event)
case EVTKEYPRESS:
print cp$(px,py), " "
num.key = evt.keypress.key(event)
on case num.key
case KEY_RETURN:
print cp$(px,py), "return"
refresh()

|/ This call works but doesnt allow switch back to menu ....
activate("owhinh9132")

|/ This stuff doesnt work ....

|/ sub.win = create.mwindow( menu.win, 16, 20, 1, 1)
|/ change.mwindow(sub.win)
|/ sub.pid = act.and.sleep( "owhinh9132")
|/ if(sub.pid)then
|/ set.pgrp(sub.pid, sub.pid)
|/ grab.mwindow( sub.win, sub.pid)
|/ reactivate(sub.pid)
|/ endif
|/ change.mwindow( menu.win)
|/
|/ print cp$(px,py), me
refresh()
break
case KEY_ESC:
print cp$(px,py), "esc"
refresh()
suspend(500)
print cp$(px,py), "exiting program ..."
refresh()
suspend(200)
prog.run = 0
break
case KEY_TAB:
case KEY_DOWN:
me = menu.cursor(last.menu.cursor+1)
print cp$(px,py), menu.entries( 1, me;11)
print cp$(px,py)
refresh()
break
case KEY_BACKTAB:
case KEY_UP:
me = menu.cursor(last.menu.cursor-1)
print cp$(px,py), menu.entries( 1, me;11)
print cp$(px,py)
refresh()
break
default:
me = is.menu.key(num.key)
if( me > 0 ) then
menu.cursor(me+2)
print cp$(px,py), menu.entries( 1, me;11)
print cp$(px,py)
refresh()
endif
endcase
endcase
endwhile
end.prog()
}



function long is.menu.key( long nk)
{
long ret
long i

ret = 0

for i=1 to LASTMENU step 1
if( asc(menu.keys(1,i)) = nk ) then
ret = i
endif
endfor
return( ret)
}

function long menu.cursor( long pos.y)
{
if(pos.y > LASTMENU) then
pos.y = FIRSTMENU
endif

if(pos.y < FIRSTMENU) then
pos.y = LASTMENU
endif

print cp$( 5, last.menu.cursor), " "
print cp$( 19, last.menu.cursor), " "

print cp$( 5, pos.y), "<"
print cp$( 19, pos.y), ">"
refresh()

last.menu.cursor = pos.y
return( pos.y - 2)
}


function end.prog()
{
if ( menu.win ) then
del.window(menu.win)
endif

end()
}

function display.empty.form()
{
print cp$(01,01), " ERPLN-Menu - 1dv05 "
print cp$(01,02), " "
print cp$(01,03), " "
print cp$(01,04), " "
print cp$(01,05), " "
print cp$(01,06), " "
print cp$(01,07), " "
print cp$(01,08), " "
print cp$(01,09), " "
print cp$(01,10), " "
print cp$(01,11), " "
print cp$(01,12), " "
print cp$(01,13), " "
print cp$(01,14), " "
print cp$(01,15), " "
print cp$(01,16), " Auswahl: "

refresh()
}
Reply With Quote
Sponsored Links
  #4  
Old 1st May 2008, 01:21
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Quote:
I'm trying to develop an ASCII Menu System for ERP-LN to start 3GL sessions from it. We are using a lot of telnet based WLAN Scan-Devices running BaanIV-3GL session. What we are missing in LN is the good old menu system.
I've developed a 3GL ASCII-Session implememting a menu - works fine !
I am not sure how the WLAN Scan Devices are interacting with the Baan menu and activating the choice.
You can add 3-GL programs in the menu structure in the LN Tools.

Your program looks good.

Try adding another statement -
activate("owhinh9132")
reactivate(pid)

If that doesn't work, you can try this option - Making related processes independent
Quote:
Is anybody out there who kows how to work with this program groups for event handling and the other stuff for parallelizing the sessions?
Refer to the link - substitute.session()
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #5  
Old 5th May 2008, 08:44
AndreasSchmitt's Avatar
AndreasSchmitt AndreasSchmitt is offline
Junior Member
 
Join Date: May 2003
Posts: 11
AndreasSchmitt is on a distinguished road
Baan: BaanIVc4 - DB: Oracle 8.1.7 - OS: Solaris 8
Unhappy

@NPRao: The Scan Devices run simple telnet sessions.

We need to run multiple BaanLN Sessions (3GL/ASCII) simultaneously, having a 'hot-key' to switch between this session. In BaanIV this was quit simple with the standard menu (Function Key) that is no longer there in LN. I 've read 'Making related processes independent' but i don't know how to get it working - I always get error messages when I try to start a session.

If there is anybody how has a 'working example' for this 'independent session thing' I would be glad to hear from you !
Reply With Quote
  #6  
Old 13th May 2008, 09:53
AndreasSchmitt's Avatar
AndreasSchmitt AndreasSchmitt is offline
Junior Member
 
Join Date: May 2003
Posts: 11
AndreasSchmitt is on a distinguished road
Baan: BaanIVc4 - DB: Oracle 8.1.7 - OS: Solaris 8
no one there ?

Is there nobody who has experience with this 'session Group thing' in 3GL Programs ? - Can't believe that ...
Reply With Quote
  #7  
Old 24th May 2008, 05:20
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Andreas,

I tested your code with the list of the sessions and found that the focus is now changed to the new sessions called by the 3-GL menu. I used act.and.sleep() so the new child processes are started and put in the sleeping queue in the background.

Here is the updated version, with some more colors feature, which compiles good in LN Tools.
Code:
	#define 	STARTPOS 	4
	#define 	MAXMENU 	12
|***************************************************************************
long 	menu.win
string 	menu.entries(16, MAXMENU), menu.keys(1, MAXMENU)
|***************************************************************************
function main()
{
boolean prog.run
long	posn, counter, px, py, num.key, prev.posn, last.posn
long	child.pid, event(EVTMAXSIZE)

prog.run = true
init.values()
px = 8
py = 3
for counter = 1 to 10 step 1
	print.line(px, py + counter, "(" & menu.keys(1, counter) & ") " &
		menu.entries(1, counter) & " " &
		tt.session.desc(menu.entries(1, counter)))
	last.posn = py + counter
endfor
print fg$(CW.WHITE)
prev.posn = STARTPOS
print.line(12, prev.posn, menu.entries(1, 1), true)
px = 20
py = 20
print cp$(px, py), " "
while(prog.run)
	next.event(event)
	if evt.type(event) = EVTKEYPRESS then
		footer.line(" ")
		num.key = evt.keypress.key(event)
		on case num.key
			case KEY_RETURN:
				footer.line("Return")
				child.pid = act.and.sleep(
					menu.entries(1, prev.posn - 3))
				refresh()
				break
			case KEY_ESC:
				footer.line("ESC")
				suspend(500)
				footer.line("Exiting Program...")
				suspend(200)
				prog.run = false
				break
			case KEY_TAB:
			case KEY_DOWN:
				print.line(12, prev.posn,
					menu.entries(1, prev.posn - 3))
				posn = posn + 1
				if posn > last.posn then
					posn = STARTPOS
				endif
				if posn < STARTPOS then
					posn = last.posn
				endif
				prev.posn = posn
				print.line(12, prev.posn,
					menu.entries(1, posn - 3), true)
				break
			case KEY_BACKTAB:
			case KEY_UP:
				print.line(12, prev.posn,
					menu.entries(1, prev.posn -3))
				posn = posn - 1
				if posn > last.posn then
					posn = STARTPOS
				endif
				if posn < STARTPOS then
					posn = last.posn
				endif
				prev.posn = posn
				print.line(12, prev.posn,
					menu.entries(1, posn - 3), true)
				break
			default:
				posn = 0
				print.line(12, prev.posn,
					menu.entries(1, prev.posn - 3))
				for counter = 1 to (last.posn - 3) step 1
					if(asc(menu.keys(1, counter)) =
						num.key) then
						posn = counter
					endif
				endfor
				if posn > 0 then
					print.line(12, posn + 3,
						menu.entries(1, posn), true)
					footer.line(menu.entries(1, posn))
					print cp$(10, 20)
					refresh()
				endif
				prev.posn = posn + 3
		endcase
	endif
endwhile
if menu.win > 0 then
	del.window(menu.win)
endif
}
|***************************************************************************
function init.values()
{
boolean	bret
domain	ttdsca	username

menu.entries(1,1) = "ttadv2500m000"
menu.entries(1,2) = "ttadv3530m000"
menu.entries(1,3) = "ttaad2500m000"
menu.entries(1,4) = "ttams2100m000"
menu.entries(1,5) = "ttaad1100m000"
menu.entries(1,6) = "ttadv3560m000"
menu.entries(1,7) = "ttadv4500m000"
menu.entries(1,8) = "ttadv4520m000"
menu.entries(1,9) = "ttadv4551m000"
menu.entries(1,10) = "ttadv4561m000"

menu.keys(1,1) = "1"
menu.keys(1,2) = "2"
menu.keys(1,3) = "3"
menu.keys(1,4) = "4"
menu.keys(1,5) = "5"
menu.keys(1,6) = "6"
menu.keys(1,7) = "7"
menu.keys(1,8) = "8"
menu.keys(1,9) = "9"
menu.keys(1,10) = "0"

menu.win = new.window(23, 80, 1, 1)
print fg$(CW.CYAN)
box(1, 1, 80, 3, 0)
print fg$(CW.WHITE)
bret = tt.user(logname$, username)
print cp$(10, 2), cf$(1), "ERP_LN_Menu" & string.set$(" ",10) & 
       username, cf$(0)
print cp$(01, 20), " Choice: "
}
|***************************************************************************
function print.line(long x, long y, const string strg(), 
                        [boolean font.option])
{
FUNCTIONUSAGE
	input positions, string, 
        font.option: true - Underscore & bold, else - normal
ENDFUNCTIONUSAGE

if get.argc() = 4 then
	font.option = get.boolean.arg(4)
else
	font.option = false
endif
if font.option then
	print fg$(CW.BLUE)
	print cp$(x, y), cf$(9), strg, cf$(0)
	footer.line(strg)
else
	print fg$(CW.CYAN)
	print cp$(x, y), cf$(0), strg, cf$(0)
endif
refresh()
}
|***************************************************************************
function footer.line(const string strg())
{
FUNCTIONUSAGE
	print input string as footer line
ENDFUNCTIONUSAGE

print fg$(CW.CYAN)
print cp$(10, 20), cf$(2), sprintf$("%-30s", strg), cf$(0)
refresh()
}
|******************************************************************************
Quote:
We need to run multiple BaanLN Sessions (3GL/ASCII) simultaneously, having a 'hot-key' to switch between this session.
To get this feature working, you have to store the child.pid into a array variable and create a new hot-key option, then to display the child processes and when a particular process is selected, call the reactivate(child.pid(i)) to switch to that process, a process tree view like ottgbfprocess would be a good interface. The only issue I found in this approach is that, if you opened a few child process and then try to exit the 3-GL menu application it waits for them to finish. You can explore using signal()s to avoid that. I noticed that ottgbfprocess always has a parent process id 0 when I started it from the status bar and has a parent process id when I start from the run program.
Have to explore something later, interesting program...
Attached Images
File Type: jpg 3gl_Menu.jpg (43.4 KB, 39 views)
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao

Last edited by NPRao : 24th May 2008 at 05:37.
Reply With Quote
  #8  
Old 5th June 2008, 12:07
AndreasSchmitt's Avatar
AndreasSchmitt AndreasSchmitt is offline
Junior Member
 
Join Date: May 2003
Posts: 11
AndreasSchmitt is on a distinguished road
Baan: BaanIVc4 - DB: Oracle 8.1.7 - OS: Solaris 8
Thanks !! but ...

Sorry for answering this late ! But I was busy with some other stuff. Thanks a lot for couloring the menu - but my main problem isn't jet solved. If I act.and.sleep() and afterwards reactivate() an other 3gl session from the menu
the called session is displayed but every key-press seems to be routed through the menu application ... after a few key-presses the menu application terminates fatal. I'll to some investigations on this thing ....
I don't see how to switch between different session in your suggestion ...
by Andreas
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
zoom to menu in GUI instead of ASCII hanslokhoff Tools Development 4 29th March 2004 17:02
How to open Menu in ASCII Mod jhansirani Tools Development 2 5th February 2004 14:16
replicate file system objects across servers Hitesh Shah Code & Utilities 3 28th June 2003 08:41
menu in commandline starts ascii croezen Tools Administration & Installation 5 11th June 2003 13:46
About menu making armiewei DEM & Workflow 4 23rd July 2002 08:56


All times are GMT +2. The time now is 02:13.


©2001-2017 - Baanboard.com - Baanforums.com