On Wednesday 09 July 2014 18:44:25 amateur wrote:
> 1.
> var
>    st : TStringList;
>    s, norms : string;
> begin
>    ...
>    s := tfiledialog1.controller.filename;
>    st.Loadfromfile(s);
>
> in linux OK, in windows has error...
> but if in windows use
>
>    s := tfiledialog1.controller.filename;
>    norms := Copy(s, 2, Length(s));
>
> stringlist loadin..
>
MSEgui file names ("filenamety") have the unified cross platform format by 
default. "c:\aaaaa\bbbb" becomes "/c:/aaaaa/bbbb". Please use
"
    st.Loadfromfile(tosysfilepath(s));
"
in order to convert to the format used by FPC RTL and FCL or use MSEgui 
classes and functions.
"
var
 st: tmsestringdatalist;
 s: msestring;
begin
 st:= tmsestringdatalist.create();
 try
  s:= tfiledialog1.controller.filename;
  st.loadfromfile(s);
 finally
  st.destroy();
 end;
end;
"
It has the advantage that it uses Unicode for file names. Also handy 
ttextstream and ttextdatastream with the readstrings() and readmsestrings() 
functions.

> 2.
> var
>    st : tmsedbf;
>    s : string;
> begin
>    ..
>    s := tfiledialog1.controller.filename;
>    st.TableName := s;
>
> in linux OK, in windows has error...
> but if use:
>    With st do begin
>      FilePath := ExtractFilePath(s);
>      TableName := ExtractFileName(s);
>
> Table load...
>
"
 st.filepath:= s;
"
Should work because it has the type "filenamety" or use "tosysfilepath".

Other options:

- Use "tfiledialog1.controller.syscommandline" instead 
of "tfiledialog1.controller.filename" - I probably should 
rename "syscommandline" to "sysfilename".

- Activate "tfiledialog1.options fdo_sysfilename".

Martin

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to