Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 3rd May 2002, 01:15
alejandro's Avatar
alejandro alejandro is offline
Senior Member
 
Join Date: Feb 2002
Location: Madrid - Spain
Posts: 144
alejandro is on a distinguished road
Baan: IV c4 - DB: Oracle 8 - OS: Unix
Local PC File Dialog Box (Unix & W98)

This code is a continuation of this thread .

It will work for:

BaaN IV c4
Unix
Windows 98

In other environments not tested.

The thread related shows how to call a Server File Browser in BaaN

This code shows the windows dialog open file. It works to select a file or a folder. The code has two parts:

tccomfindwinf.exe: A VB script that must be compiled and stored in the server.

tccomfindwinf: 3GL script that has to be called to execute tccomfindwinf.exe and take the file or folder name selected.

Here is the code:
Attached Files
File Type: zip tccomfindwinf.zip (3.0 KB, 574 views)

Last edited by ~Vamsi : 3rd May 2002 at 02:10.
Reply With Quote
Sponsored Links
  #2  
Old 17th April 2003, 12:59
PeterH's Avatar
PeterH PeterH is offline
Member
 
Join Date: Aug 2001
Location: Maastricht - Netherlands
Posts: 53
PeterH is on a distinguished road
Baan: Baan IV c4 - DB: Oracle 8 - OS: unix
I'd to make one change

To get the visual basic code working on a w2k system I had to make the following changes:

Original code:
Dim fname As String
filebox.lpstrFile = Space(255)

Changed to:
Dim fname As String * 255
filebox.lpstrFile = fname

Alejandro thanks.
Reply With Quote
  #3  
Old 13th June 2003, 10:59
dorleta's Avatar
dorleta dorleta is offline
Senior Member
 
Join Date: Dec 2001
Location: Madrid - Spain
Posts: 133
dorleta is on a distinguished road
Baan: BaanIV - DB: All - OS: All
another solution maybe

I have down the java class to local probably it is not neccesary and with a little modification you can get a file in the server or local pc in all the systems win, unix...

code of the baan dll:
Code:
function extern string aemcs.expl.local.file()
{
	long dummy, fich, dummy2

	string destino(50)
	string bufer(80)
	dummy = remove.local.file("c:\tmp.txt")
	dummy = server2client("/interfaz/Explorador.class", "c:\Explorador.class", false, false)

	remove.local.file("c:\tmp.txt")


	dummy2 = app_start("javaw Explorador", "c:\\", "", "", "")
	if dummy2 < 0 then
		return("")
	endif
	destino = creat.tmp.file$()

	fich = -1

	while fich < 0 
		dummy = client2server("c:\tmp.txt", destino, false )
		while dummy < 0
			dummy = client2server("c:\tmp.txt", destino, false )
		endwhile
		fich = seq.open(destino, "r")
		dummy = seq.gets(bufer, 1000, fich)
		while dummy < 0
			dummy = seq.gets(bufer, 1000, fich)
		endwhile
		seq.close(fich)
		file.rm(destino)
	endwhile


	return(bufer)



}




code of the java class:
Code:
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.lang.*;

public class Explorador extends Frame
{	

	public Explorador()
	{
		this.addWindowListener	(new WindowAdapter(){
			public void windowClosing(WindowEvent e){
				dispose();
				System.exit(0);
			}
		});
	}

	
	public static void main(String args[])
	{
	String Cadena = new String();

	Explorador f = new Explorador();
 	f.setSize(10,10);
	f.show();
	f.hide();
	FileDialog diag = new FileDialog(f, "Seleccionar Fichero", 0);
	diag.show();
	Cadena = diag.getDirectory() + diag.getFile();
	System.out.println(Cadena);
			
			// para crear un puntero de lectura de el fichero es obligatorio
			// el bloque try ya que hace un throws a una excepción (ver ayuda)
			
	try {
		FileWriter fr1 = new FileWriter("c:\\tmp.txt");
		BufferedWriter bw = new BufferedWriter(fr1);
		PrintWriter salida = new PrintWriter(bw);
		salida.println(Cadena);
		salida.close();	
		}
		
			// se recoge la excepción
				
	catch(java.io.FileNotFoundException fr1) {
	System.out.println("Archivo no encontrado: " + fr1);}
	catch(java.io.IOException ioex) {};

	

	System.exit(0);

	}
}
Reply With Quote
  #4  
Old 13th January 2005, 21:42
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,032
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
Latest feature ->
Quote:
SSA ERP LN 6.1 Programmer's Guide

dir.select.dialog.local()
--------------------------------------------------------------------------------
Syntax
long dir.select.dialog.local( ref string dirname )
Description
This shows the Windows Browse For Folder dialog, to allow the user to select one new or existing folder (directory) on the client.

Arguments dirname
Output argument which will contain the full path of the directory selected by the user.

Return values
1 A directory selected by the user
0 No directory selected. Folder browser dialog canceled by the user.

-1 Error occurred

Context
ttdllbw library function.
__________________
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
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 Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
writing a log file from a Unix script pjohns Operating Systems & Databases 8 11th April 2003 22:52
.txt file - Notepad vs Wordpad popeye Tools Development 5 1st March 2003 01:59


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


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