FlagShip: Frequently Asked Support Questions (06-May-2004) ------------------------------------------------------------------------ Note: This file is frequently upated. Check for the latest version on http://www.fship.com/whatsnew.html or click the "What's new" link or the "Support" button on the FlagShip home page http://www.fship.com 1. Internet Access, Licensing, Testing, Purchase 2. Installation, customizing 3. FlagShip preprocessor & compiler 4. Programming hints 5. Running the applic, environment, system, communication 6. Program size, multiuser/multitasking 7. Screen output 8. General, RDDs 9. SCO Unix Notes (see also section REL in the manual) 10.Linux Notes (see also section REL in the manual) 11.FreeBSD Notes 12.Sun Solaris Notes (see also section REL in the manual) 13.HP-UX Notes (see also section REL in the manual) 14.GNU gcc notes for AIX and other systems 15.Year 2000 16.Support ---- 1. Internet Access, Licensing, Testing, Purchase ------------------- Q: Where can I obtain free Demo of FlagShip ? A: The FlagShip demos for various operating systems are available on CD-ROM (contact ) and for a free download in Internet via http://www.fship.com/eval.html For some commercial Unix systems, use http://www.fship.com/demos.html or via anonymous ftp in the directory ftp://fship.com/pub/multisoft/flagship/demos/ or ftp://213.183.1.173/pub/multisoft/flagship/demos/ Q: How can I access the FlagShip ftp server ftp://fship.com/pub/multisoft via Internet for info or to download free test drives ? A: On Internet, you may use your Web browser and click the "Support" or "Demos" button in the http://www.fship.com home page. Alternatively, you may use anonymous ftp://fship.com/pub/multisoft. In detail: or or , login,Name= or , password=, , , , , , , . Read the /pub/multisoft/IN* files for further navigation. The FlagShip test drives are available in /pub/multisoft/ flagship/demos. Alternatively, you may use the Web server http://www.fship.com/ with corresponding links. Q: What are the limitations of the free Eval or Demo version? A: For Linux, there is an ulimited Test/Eval version of Visual FlagShip available via http://www.fship.com/eval.html for a 30 days evaluation period. It has no other limitations compared to the PRO license. For other commercial Unix systems, the FlagShip Demo/Test drive is fully functional. It lets you evaluate FlagShip with your applications without any risc. Compared to the full FlagShip license, it is limited only as follows: - The compiler and with it produced executables run for 30 days, but may be freely reinstalled again. The produced executable has a 1 hour run-time limit and supports four users simultaneously. - Any number of records are supported, but only the first hundred physical records of the .dbf are writable. This means, you will most probably prefer small test databases during the evaluation. - The execution speed is reduced significantly. That's all. See further details on http://www.fship.com/price.html Q: Is the "Free Personal FlagShip" for Linux the same as the free Demo? A: No, it isn't. The "Free Personal FlagShip" is similar to the commercial "Personal FlagShip" license. See also the next question. Q: May I use the "Free Personal FlagShip" on Linux also for evaluation purposes in the company ? A: No, you would violate the license agreement. The "Free Personal FlagShip" can ONLY be used for strictly personal and education purposes and for developing of FREE public software, see http://www.fship.com/license.html for details. But there is a Demo/Test drive available for a free evaluation. Q: May I install and use the "Free Personal FlagShip" (or the company license) on my notebook to continue with a company or commercial development at home ? A: You may not. For any commercial purposes, a commercial FlagShip license is required. On your notebook, you will need a second commercial license (Personal or Pro) when the licensed FlagShip is already installed at the company site. Q: How to purchase FlagShip license? A: You can order at your local dealer, via e-mail , phone (++49-89-6490040), fax (++49-89-6412974) or via secure server http://www.fship.com/order.html, by specifying the used platform. Please refer to http://www.fship.com/price.html for prices and porting details, as well as to http://www.fship.com/license.html for licensing details. Q: I have "Free Personal FlagShip" and need now the FlagShip Pro license. Is the "upgrade FS Personal to Pro" price valid there? A: You will need to purchase the FS Pro license. The upgrade price is valid only for upgrading the commercial Personal license to Pro. Or as a joke, a quiz question: "How to upgrade bottle of free beer to regular six-pack?" :-) Q: My application use functions of the Clipper CA2/NT3 toolbox. Where can I get it for FlagShip? A: For FlagShip, there is FS2 Toolbox available, see full details on http://www.fship.com/tools.html. You may purchase it for your commercial Personal or Pro license (sorry, not available for the Demo and "Free Personal FlagShip"). See also chapter 8 below for other libraries. ---- 2. Installation ---------------------------------------------------- Q: On RedHat 8.x, I get rpm installation error reporting that dos2unix and unix2dos is allredy installed. A: Sorry, we have no influence on naming RedHat's new packages, added in the new distribution. You can either - (preferably) uninstall the dos2unix and unix2dos package via "rpm -e dos2unix" and "rpm -e unix2dos" before installing FlagShip, or - use the --nodeps and --force switches of rpm when installing FlagShip, or - use the non-rpm installation available on the FlagShip CD-ROM Q: I cannot install my Demo version, error 2 occurs in FSinstall A: Check for a _correct_ system date before installing the Demo and make sure there are no files dated in the future on your system # touch `date +%m%d2359` xxx ; find / -newer xxx -print 2>/dev/null Q: Where can I find the, often referred to, FlagShip Release Notes (REL) for my system ? A: The Release Notes is one of most important sections of the FS docu. You will find it alternatively: a) in the printed manual, b) the on-line manual (fsman) section REL, and c) in the ASCII file itself in /usr/FSsrc/manual/relnotes.asc, or d) on the FlagShip CD-ROM. Q: When I install FlagShip for Linux 2.0.3x from the CD-ROM, I get a message "fsman returned error 231" and the installation script is aborted. A: At this stage, the installation of FlagShip is complete, but it signals that you will get problems running your executables (see details below in section 10). Therefore apply the patch#447 (available from http://www.fship.com via the "What's new" link or "Support" button). Note: you will receive this patch on floppy from your supplier with a new CD-ROM purchase. Q: When I run the FSinstall (or FSinstCD) script on RH Linux, I get a message that my system is missing "libm.a" and "libc.a" from the "libc" package. Why? A: Normally when you link a binary, dynamic linking is used; this saves disk and memory space. However, static versions of the Linux libraries are provided in a separate package, which is in the file RedHat/RPMS/libc-static-5.3.12-17.i386.rpm on the CD-ROM. To install this, mount the Red Hat 4.2 CD and type rpm -i /mnt/cdrom/RedHat/RPMS/libc-static* Q: When I install FlagShip from the CD-ROM on SuSE 6.2+ and 7.x based Linux distribution, the installation script FSinstCD suggests to install Glibc instead of the correct Glibc-2.1 based FlagShip. Why? A: The script checks the availability of libc-2.1.so, which is not present in SuSE distribution (but Glibc-2.1 is included in libc.so.6, see details in http://www.fship.com/linux.html). So simply select the Linux Glibc-2.1 from menu and confirm the installation prompt to continue with the Glibc-2.1 based installation. Q: Does FlagShip run also with GNU C instead of the default C development package for systems other than Linux? A: For the most Unix systems, you may also use the free gcc. Check the http://www.fship.com/gcc_gnu.html page for details and links to some of ready-to-run gcc's. Most probably, you will only need to slightly modify the /etc/FSconfig file (see details in fsman sect FSC.1.4.2), i.e. lines CCNAME: gcc PREOPTIONS: -D -fwritable-strings -fPIC When using also the GNU libc.a (or libc.so) library instead of system own, consider the GNU LGPL license as noted in section 10 below. Q: Which files should/need I pass to my customer with the application? A: Your customer will need (see also fsman sect SYS.1.2 and GEN.2): the same operating system as your is, and - your executable (a.out etc) and databases (*.dbf and *.dbt if required) - /usr/bin/newfs* scripts - /usr/lib/terminfo/FS* files - /usr/lib/keyboard/FS* files and when compiled dynamically: /usr/lib/libFlagShip.so in this case, check also at the customer site, if /usr/lib/libc.so[.*] is available and if of the same release as yours. If not so, you have to recompile your applic statically, by modifying the /etc/FSconfig file (or a local copy of) accordingly optionally: - /usr/lib/terminfo/F/* (or /usr/lib/terminfo/f/* on Linux resp.) - or compile "cd /usr/lib/terminfo; tic FStinfo.src" at the customer site as root or su (or "tic194 FStinfo.src" on Linux ELF respectively, you will also need to provide the /usr/bin/tic194 file in this case) In any case, you may not pass the licensed files FlagShip*, libFlagShip.a and dynFlagShip.o, see details in the License Agreement (fsman GEN.2). ----- 3. FlagShip preprocessor & compiler -------------------------------- Q: When transferring DOS programs to Unix, I see ^M at the end of each line. A: The ^M represents the CR mark. DOS marks the end-of-line by using the CR+LF combination, while Unix by LF only (see the FlagShip manual LNG.1.3 and LNG.9). Don't worry, FlagShip will handle also DOS files correctly. For editing purposes, you may use the dos2unix, d2u or FSload utilities, see also section FSC.6 and REL in the manual. But DO NOT CONVERT or manually modify BINARY files, e.g. *.dbf, *.dbt, *.mem and *.idx ! Q: The statement "IF [aa] = anyvar" seems not to work in FlagShip 4.3. A: The FS 4.3x preprocessor cannot determine, whether this is an IF statement or an IF[aa] array assignment. Using IF "aa" = anyvar or IF "aa" == anyvar will avoid the compiler warning. In FlagShip 4.4, also the "IF [aa] = ..." construct is supported. Q: The IF ... ELSE ... ENDIF does not work if specified in std.fh A: The IF ... control structure cannot work if attempting to differentiate between e.g Fox and FlagShip code, since the std.fh is used during the compilation phase, while IF, ELSE etc. are run-time commands and the variable is available also at run-time only. What you probably want to use is #IFDEF FlagShip ... #ELSE ... #ENDIF instead. Q: The directive #command SCROLL ,,,, => (...anything...) does not work when CLEAR SCREEN or the SCROLL() function call is used. A: In such a case, specify #xtranslate SCROLL() => Scroll(NIL) at the end of std.fh Q: The #define xx(a,b) xx(a) directive causes a preprocessor recursion. A: The FlagShip preprocessor #define directive works similar to the C preprocessor. You may change this specific behavior by specifying #xtranslate xx(,) => xx() which works both in FlagShip and Clipper. Q: The "#define xx(a,b) a+b" and "#define yy(a,b,c) c:=xx(a,b)" direc- tives when composed sometimes produce an unpredictable result. I.e. the "yy(1,2,var)" and "var := xx(2,3)" statements works fine, but "yy(1,xx(2,3),var)" does not. A: FlagShip's #define directive currently supports nesting but not composition. You may use #xtranslate xx(,) => +" and "#xtranslate yy(,,) => \:\=xx(,)" in such cases instead. Q: Where is the main difference between Clipper's and FlagShip's preprocessor? Any additional hints? A: Both work nearly equivalent, while FlagShip's does it more precisely: 1.The main difference between FS and Clipper is in the "translation" handling of the s. In Clipper, a simply textual replacement is done, whereas in FlagShip the result is checked to see if it is actually _valid_ expression. 2.The use of operators (such as ":=", "=", "-=" etc.) as a keyword (match marker) may result in unexpected results or will not be translated at all, because of (1). If so, replace the operator at the left side of the translation directive by a keyword (for example the ":=" operator by the "IS" keyword, "=" by "EQ" etc.). Your directives and sources then remain backward compatible to Clipper as well. 3.The optional list match [] works slightly differently from Clipper, because of (1). As a general rule, you should specify markers following fix command parts first and put the optional (repeating) markers at the command end. 4.Note that non-optional repeating markers (i.e. comma- separated markers) are resolved differently from the optional markers [] where the comma is also optional. 5.When possible, don't translate command names to themselves #command but translate to another command (see e.g. the @..GET in std.fh) which simplifies the preprocessor's task. 6.If two or more optional matches e.g. [] are used but not coupled with command keywords e.g. [COLOR ], the preprocessor is not always sure about how to match because of (1). You should then use e.g. [,...] [,...]. 7.You should also use #command instead of #xcommand in repeated trans- lations with the std.fh (such an additions to @..SAY etc), since the clauses are often abbreviated there (refer e.g. to std.fh approx line 530). 8.You may check the translation of your directives in the .bp file when compiling with "FlagShip -a .prg". Q: Why cannot I release the "PUBLIC FlagShip" variable? A: PUBLIC FlagShip is a reserved variable and cannot be released, see manual sect. CMD pg.162 Q: When issuing PUBLIC anyvar ; RELEASE anyvar ; PUBLIC anyvar, the last declaration does not set to the LOGICAL type A: Correct, FlagShip sets only the first occurrence of PUBLIC variable to be logical. RELEASE will reset it to NIL only. FlagShip 4.4 supports it the same way as Clipper 5.x. Q: Some of my commands, like COPY FILE (m_var1)+".txt" TO (m_var2)+".txt" produce a compile-time error A: According to the FlagShip and Clipper manuals, both the arguments should be either a file name or parenthesed expression. Using the correct syntax COPY FILE (m_var1+".txt") TO (m_var2+".txt") works fine, both with FlagShip and Clipper. Q: When compiling my old prg files, which redefine the standard FlagShip ones (like getsys.prg or dbedit.prg) with the new 4.4 release, I sometimes get compiler warnings. Why? A: The standard functions of FlagShip 4.4 use prototyped parameters and return values. This speeds up the execution and allows to check the passed and retrieved arguments already during the compile-time phase (if the warning level 3 is used), in addition to the run-time checks. With lower warning level, you will receive compile-time warnings only if the passed or returned type does not match the expected one. You may DISABLE the prototype checking at compile-time by commenting- out the statement #include "stdfunct.fh" at the end of the /usr/include/ std.fh file. Q: In FlagShip 4.4, I cannot REPLACE fields via macro, when the macro string contains an embedded alias. A: To handle this, you may add the preprocessor directive #command REPLACE WITH [[,] WITH ] ; => if("->" $ #, := , _FIELD-> := ) ; [;if( "->" $ #, := , _FIELD-> := )] into your .prg source or at the end of the [/usr/include/]std.fh file, or simply use an assignment, e.g. "&myField := value" . ----- 4. Programming hints ----------------------------------------------- Q: FlagShip 4.4 support both the standard and user definable classes. Can I also use macros for a dynamic access to methods or instances? A: Yes, you can. For example, LOCAL cVar1 := "COL", cVar2 := "LEFT" PRIVA oVar3 := GetList[1] nvalue := &("getactive():" + cVar1) // = getactive():col oRet := oVar3:&cVar2() // = getlist[1]:left() &("oVar3:&cVar2()") // = dito oVar3 := MyObject nRet := &("oVar3:" + cVar1) // = MyObject:col Q: FlagShip supports and documents the use of different types of class instances, which are all local to each instantiated object. Can I specify also instance variables to be common for (shared among) all objects of that class? A: Yes, you can, e.g. by using common static vars. Here an example: * Using the C++ like OOP structure in FlagShip 4.4 * class Foo * { * public: * static int PubClassVar; * int LocClassVar; * }; * * Compile: FlagShip ooptest.prg -na -Mtestme ; a.out static PubClassVar := 0 AS INTVAR // common for all Foo objects CLASS Foo EXPORT LocClassVar := 0 // local object instance PROTO ACCESS PubClassVar CLASS Foo // common class instance PROTO ASSIGN PubClassVar(val) CLASS Foo // common class instance ACCESS PubClassVar CLASS Foo return PubClassVar ASSIGN PubClassVar(val) CLASS Foo return PubClassVar := val Function TestMe() Local oFoo1 := Foo{}, oFoo2 := Foo{} ? "oFoo1:", oFoo1:LocClassVar, oFoo1:PubClassVar, ; // 0 0 "oFoo2:", oFoo2:LocClassVar, oFoo2:PubClassVar // 0 0 oFoo1:LocClassVar := 3 oFoo1:PubClassVar := 5 ? "oFoo1:", oFoo1:LocClassVar, oFoo1:PubClassVar, ; // 3 5 "oFoo2:", oFoo2:LocClassVar, oFoo2:PubClassVar // 0 5 (note) return Q: I have many Clipper programs that extensive use the *.ch header files. Is there other way to reduce program changes than copy the *.ch files from DOS ? A: Yes, since the FlagShip *.fh header files are almost backward compatible to Clipper's *.ch. You may simply create symbolic links. Type/execute $ su # cd /usr/include # for i in *.fh ; do # j=`basename $i fh`ch # note the back quotas # if [ ! -f $j ] ; then # ln -s $i $j # fi # done which lets your sources unchanged. This is already done during the installation of FlagShip 4.4x. Q: When I try to load (use) a dbf file, this message is shown: "DBFIDX:Init() the file has 0x4 as version code RTE 326 (Wrong version of DBF file)" A: You're using dBase IV or dBase V database format, whilst FlagShip support the common dBaseIII+ structure (see fsman sect LNG.1.3, LNG.2.1, LNG.9). There are two ways to use your databases: a) start your dBase4/5 and convert the .dbf (and .dbt) into dB3/3+ format, then use these new files. Pls refer to the dBase docu for details. b) if the database has not the extended db4/db5 fields (i.e. has only C,D,L,N field types), you may "patch" them once before opening: Local buffer, hnd, version buffer := space(1) hnd := fopen("mydata.dbf", 2) // open the database file r/w fread (hnd, @buffer, 1) // read 1st byte version := strpeek(@buffer,1) // database version do case case version == 4 .or. version == 5 strpoke (@buffer, 1, 3) // change it to 0x03 fseek (hnd, 0, 0) // rewind file fwrite (hnd, @buffer, 1) // and write back case version == 139 ? "convert dBaseIV .dbt memfile to dB3+ format first" quit case version == 245 ? "convert FoxPro .fpt memfile to .dbt format first" quit case version == 142 ? "cannot use SQL tables" quit case version != 3 .and. version != 131 .and. version != 179 ? "not a database file" quit endcase fclose (hnd) // close the file use mydata ... // use now as usual Q: FlagShip will not accept database fields passed to RANGE clause of GET. I get a RTE 204, illegal field type, in rangecheck(). Why? A: As opposite to the standard parameter passing, FlagShip must handle the GET data/parameters differently to be able to replace database fields too. Therefore, only constants, variables or expressions are accepted in the RANGE clause. You can e.g. use one of: Local numVar := 0, tempVar := numField @...GET numVar RANGE 0, numField // this fails with RTE 204 @...GET numVar RANGE 0, numField +0 // ok, same as all the next @...GET numVar RANGE 0, tempVar @...GET numVar RANGE 0, round(numField) @...GET numVar RANGE 0, abs(numField) @...GET numVar RANGE 0, myUdf() // funct myUdf; retu numField @...GET numVar VALID(numVar >= 0 .and. numVar <= numField) read Q: FlagShip's @..GET..PICTURE behavior differs from Clipper when the picture is shorter than the variable size. Although the behavior is not described in Clipper, why the difference? A: FlagShip tries to fix an insufficient PICTURE size automatically to avoid an unintended data loss - a fatal accident in data processing. Let's assume cVar := myDbf->myField @ y,x SAY "Local cost" GET cVar pict "999" ; READ In Clipper, you will see and can edit Local cost [ 20] but in FlagShip e.g. Local cost [ 20 Pesos] which avoids any possible misinterpretation (I may assume the edited value is in US$) or data loss by programmer's fault. If you need to reproduce the Clipper behavior, split the variable, e.g. cTmp := left(myDbf->myField,3) @ y,x SAY "Local cost" GET cTmp pict "999" ; READ cVar := cTmp + substr(myDbf->myField,4) which is a controlled, and the same behavior in Clipper and FlagShip. Q: Clipper supports code blocks in @..GET..VALID {|oGet|...}. When using this in FlagShip, I get compiler-time error. Are code blocks unsupported? A: Code blocks are supported by FlagShip too, also in a VALID clause. The only difference is the stronger compiler checking in FS (VALID requires logical expression). In this case, you need to pass the code block in a variable to be run-time processed (instead of using constant), e.g. Local bValid := {|oGet| myudf(oGet,...)} @..GET..var...VALID bValid Q: In FlagShip, there are three different C APIs. May I mix those? A: The short answer is: You may use "Open C" macros and functions in the "Extend C" API (which is almost compatible to Clipper), but not reverse. The long answer: When specifying a UDF via the "Extend C" API, FlagShip special initialize the stack by using the FSudfname() and FSinit() macro. You can then also use Open C API macros, e.g. for an access to standard FS functions and .prg variables, macros, code blocks etc, but need to return from this UDF via _ret*() and FSreturn. If your UDF is declared by UDF_DECL() macro from Open C API instead, or you are using the "Inline C" within your .prg, the special stack initialization is omitted and you therefore cannot use any macro from Extend C API, but from the (more powerful) Open C API only. The full API description is in the FlagShip manual, section EXT. ----- 5. Running the applic, environment, system, communication ---------- Q: Coming from dBase and FoxPro, I am missing the interpreter for a quick database maintenance. Do I need every time to create an executable, containing e.g. a simple browse() statement, to do this? A: You can, but don't need to. There is a FlagShip interpreter named "fsi" available in source via http://www.fship.com/tools.html which works the same way as dBase or Fox. You may alternatively use the dbu executable, available in /usr/bin or in /usr/FSsrc/tools/dbu Q: FlagShip is very fast. Can I additionally increase the performance ? A: Yes, by using the typed variables in calculations and loops. Your .prg may remain backwards compatible to Clipper, e.g. #ifndef FlagShip # define LOCAL_INT LOCAL #endif LOCAL_INT ii, yy := 0 FOR ii := 1 to 100000 ; yy++ ; NEXT Typed variables may increase the performance by 500% and more. In FlagShip 4.4, you may also prototype your user defined functions or objects/classes. The correct syntax and calling convention will then be checked already at compile-time. Q: Can I avoid all the output from my application including screen init? A: Yes, use redirection, e.g. $ a.out > /dev/null or on Linux to an unused pseudo tty instead, e.g. $ chmod +w /dev/ptyqf $ a.out > /dev/ptyqf In FlagShip 4.4, you may also fully disable the curses initialization, when the direct screen input/output is not required. See details in the chapter SYS.2.7 of the manual. The simplest use for disabling redirect all the output to stdout and to disable stdin is to include an empty function CursesInit() somewhere in your application, e.g.: ? "hello world" ; ? return Function CursesInit() return NIL Q: How can I redirect the stdout output on Linux ? A: FlagShip uses the Linux curses library for output to stdout, by default assigned to your terminal device. Since the Linux implementation of curses requires a terminal device for output, you cannot use pipes and/or tee to redirect it to other than a device. Therefore you may use the SET PRINTER as an alternative (see fsman sect LNG.5.1 and CMD.SET PRINTER). Another possibility is using the "script" command (see "man script"), e.g. $ script my_file $ a.out $ exit In FlagShip 4.4, you may disable the curses initialization and then redirect the std output (if any) to a usual file, see SYS.2.7 in the manual. Q: How to use FlagShip in background or started by cron/crontab or procmail? A: Redirect the output of your background process to file, e.g. SET PRINTER TO myfile ; SET PRINT ON and then redirect the stdout, e.g. $ at hhmm $ a.out > /dev/null or $ a.out > /dev/null & See above redirection for Linux. The output may be viewed by Unix cat, the TYPE command or FREADSTR() function in another FS application. In FlagShip 4.4, you may disable the curses initialization and IOCTL for input and/or output. There are also ready-to-use mail functions available in the standard FlagShip library, see web*() functions in section FSC in the on-line manual. Q: When I run the application in background and disable the output by redirecting it to /dev/null (or pseudo device on Linux), the application seems to hang. A: Most probably, your application is awaiting an input or a key press. In FS4.4, disable curses and enable "CALL fgsIoctl2" according to SYS.2.7 and use redirection, e.g. "a.out < /dev/null > /dev/null &" Q: I am connected to the server via TCP/IP (or modem, Internet etc.) How can I print locally, i.e. not on the server's but my printer? A: Many terminal emulators support VT escape sequences for re-directing the output to a local printer. Check e.g. a large collection of terminal emulators at http://winfiles.com/apps/nt/terminals.html or http://download.com.com/3120-20-0.html?qt=terminal+emulator+windows for MS-Windows and http://metalab.unc.edu/pub/Linux/X11/terms for Unix. See also details and ready-to-go example in the on-line manual section CMD: SET PRINTER. Alternatively, you may use Samba to print over the network or to Windoze printer, or redirect the lpr output to a IP address when the printer is connected to the net. Q: Why the function IsPrinter() always return .T. ? A: Because of the multi-user and multi-tasking nature of Unix/Linux, the peripheral devices are usualy used in shared mode, i.e. by several users at a time. Therefore, the preferred printer output is via spool which then manages the print queues automatically to avoid garbage. See details in the FS manual (section CMD, SET PRINTER) and examples how to invoke the Unix/Linux spooler named lp or lpr. Since FlagShip don't know anything about the spooler configuration nor where the output is redirected, it safety returns "printer is available" status from IsPrinter(). But you may check ANY device for availability if explicitly required, e.g. local fd := fopen("/dev/lp2", 2) // for 3rd paralel port local isPRNavailable := fd > 0 // use this instd. of IsPrinter() if fd > 0 ; fclose(fd) ; endif Q: How can I communicate with another applications via serial port or modem ? A: There are ready-to-use functions for serial communication in the FS2 Toolbox (see http://www.fship.com/fs2tools.txt). But FlagShip is perfectly capable of handling serial ports via the FOPEN(), FREAD(), FWRITE(), FCLOSE() functions, since on Unix, serial ports can be used just as any other files (see manual section FUN). Here is a small sample program to get you going with FlagShip and serial ports: #include "fileio.fh" #include "error.fh" LOCAL com_handle, com_device := "/dev/ttys1" LOCAL com_buff := " ", com_init := "AT&V"+chr(13) com_handle = FOPEN(com_device, 2) // open the COM port IF com_handle < 1 // error handling ? com_device, "device open error", FERROR() QUIT ENDIF RUN ("stty 19200 min 1 raw <" + com_device) // configure the COM port * FWRITE(com_handle,com_init,LEN(com_init)) // init modem (if required) WHILE inkey() != 27 // read the incoming DO WHILE FREAD(com_handle, @com_buff, 1) == 1 // data until ESC ?? com_buff // display it ENDDO END FCLOSE(com_handle) QUIT That's all. Q: Can I use Unix pipes for interprocess communication in FlagShip ? A: Yes, FlagShip is prepared for it, see also the command SET PRINTER TO PIPE ... and section EXT.5 in your FlagShip manual. Another example: *** file receiv.prg LOCAL start := seconds(), ii LOCAL pipe_handle, pipe_buff := " " RUN ("sender >>/dev/ptyqf &") // start the sender in background pipe_handle = FOPEN("/tmp/pipe.4me", 2) // open the pipe IF pipe_handle > 0 // error handling WHILE (seconds() - start) <= 10 IF FREAD(pipe_handle, @pipe_buff, 1) == 1 ?? pipe_buff ENDIF ENDDO FCLOSE(pipe_handle) ENDIF *** EOF receiv.prg *** file sender.prg SET PRINTER TO "/tmp/pipe.4me" ; SET PRINTER ON ? "Hello world, I am " + netname() SET PRINTER TO *** EOF sender.prg $ FlagShip sender.prg -o sender $ FlagShip receiv.prg -o receiv $ mknod /tmp/pipe.4me p ; chmod +rw /tmp/pipe.4me # create named pipe $ ./receiv # start receiver Q: How can I invoke Unix commands from a FlagShip application? A: The simplest way is to use the RUN command; FlagShip supports it fully including an additional MESSAGE clause. You may alternatively use the Unix system() function (see "man system", "man popen" etc.), and the FlagShip manual sect EXT. Example: *** myprog.prg LOCAL_INT pidNum LOCAL mystr := "", mymask := "*.prg" RUN MESSAGE "press any key" ("ls -l " + mymask) inkey(0) ; CLS #Cinline { #include "FSopenc.h" char buff[251]; FILE *pipe; if ((pipe = popen("uname -a", "r")) != NULL) /* see Unix 'man popen' */ fgets (buff, 250, pipe); pidnum = getpid(); /* get current PID no */ SET_VAR_CHR (VAR_NAME_LOCAL(mystr), buff); /* result in FS variable */ } #endCinline ? "The Unix command 'uname -a' says:", mystr ? "and the current process number is", int(PidNum) *** EOF myprog.prg Q: When re-rooting the output to a file (via SET ALTERNATE or SET PRINTER TO), and then viewing the file with vi, vi reports "incomplete last line". A: The "?" command or QOUT() function sends a new-line before printing the output text (therefore, you may continue the output by using ?? or QQOUT). You may ignore this vi specific warning, or send an additional new-line [by the "?" or "QOUT()" statement] at the end of your output. Q: FlagShip has the GETENV() function to retrieve any known environmental setting, e.g. currTerm:=GETENV("TERM"). How can I check or retrieve the WHOLE environment ? A: The following function will return you a string similar to the # env Unix command, whereby the single environment lines are separated within the string with CRLF = chr(13)+chr(10): FUNCTION GetFullEnv() // invoke e.g.: ? GetFullEnv() LOCAL ret := "" #Cinline { # include "FSopenc.h" extern char **environ; int ii = 0; while (environ[ii]) { u_add_c (VAR_NAME_LOCAL(ret), environ[ii], 1); u_add_c (VAR_NAME_LOCAL(ret), "\r\n", 1); ii++; } } #endCinline RETURN ret You may also create an array variable containing the environment string in each array element, e.g. (with FlagShip 4.4 Open C API): ? "Current environment:" aeval(GetEnvArray(), {|x,i| qout(str(i,3), '= "' + x + '"')}) FUNCTION GetEnvArray() // invoke: aEnv := GetEnvArray() LOCAL aRet := {} #Cinline { # include "FSopenc.h" extern char **environ; FSvar *arg[2]; int ii = 0; VAR_NEW_ARGS (arg, 2); while (environ[ii]) { arg[0] = VAR_NAME_LOCAL(aret); arg[1] = SET_VAR_CHR (arg[1], environ[ii]); UDF_EXEC(aadd)(2, arg); /* std. AADD() function */ ii++; } } #endCinline RETURN aRet Q: How can I determine the REAL name of the currently running executable ? A: In FlagShip 4.4, the standard functions EXECNAME() and EXECPIDNUM() are available. Q: My executable runs fine as root or superuser, but I get an I/O error when opening the database/index, as a regular user. A: Your permissions (access rights) are insufficient. Check the owner and permissions of the directory containing the database and indices as well as the access rights of the files themselves. For the directory, ls -l should display drwxrwx--- and at least -rw-rw---- for the .dbf, .dbt and .idx files to access them by the owner and group. Refer to the FS manual LNG.3.3 and "man chmod" for additional info. Q: How can I run my applications in client/server environment, i.e. the executable in one Unix/Linux box and and data files on another server? A: Simply install NFS and place the data on the remote server. Make sure the NFS setup support locking. Read more details about NFS in "man nfs" and on Linux how-to's, e.g. "zless /usr/share/howto/en/NFS-HOWTO.gz". Be aware, that the NFS may slow-down the processing significantly, depending on the connection used (ethernet/telephone line etc). Q: Can I use FlagShip as a database for WEB server? A: Yes, it is used very often so. Simply disable the screen oriented input/output and create the dynamic HTML page by redirecting the ? ... statements to a file. See details and examples in the fs4web.html file. There are also useful web*() functions available in the standard FlagShip library, check the on-line manual. Alternatively, there several Web and CGI toolboxes available on the http://www.fship.com/tools.html page. Q: Can I run the executable locally and access common data via NFS? A: Yes for Unix/Linux based FlagShip executables. You can mount the remote filesystem via NFS (using NFS-3 and rw,lock,sync options). But you will get better performance, when the executable run on the server (because of local HD access) and "shuffle" only the user i/o through the network. You may execute the application via ssh, telnet, emulators, X11 redirection or emulator, CGI, mirroring etc. see also http://www.fship.com/emulators.html Q: Can I run the executable locally and access common data using Samba? A: Yes for MS-Windows based FlagShip executables accessing data on Unix/Linux server. Technical note for Linux/Unix based FlagShip users: As opposite to NFS, you cannot run Linux/Unix executable accessing data on mounted Samba file system and which requires byte-wise locking. This is because the current Samba system (smbfs with smbclient vers. 2.2.x and kernel 2.4.x) does not support Unix-like byte-wise locking, used in FlagShip e.g. for RLOCK() and FLOCK(). This restriction does not apply for MS-Windows applications (i.e. compiled with FlagShip for Windows), since Samba supports by default DOS and MS-Windows locks -- but these are fully incompatible to the standard fcntl() used by Unix/Linux applications. Hopefully later Samba and/or kernel releases will support Unix lockings too. In the meantime, Linux/Unix based applications should use standard NFS mounts or remote access. ----- 6. Program size, multiuser/multitasking ---------------------------- Q: Why is the executable size of a small applic about 400 Kb ? A: Same as all other Xbase languages, FlagShip fully supports run-time evaluation and compilation (macros and code blocks). Since the compiler cannot determine, whether macro evaluation is somewhere used (may be a part of e.g. the index key, used in debugger etc), the executable always includes the runtime-evaluator. The run-time variable handling and dynamic variable scoping, typical for all Xbase languages, as well as I/O and database APIs produces an overhead of approx. 300 Kb. The same applies also for e.g. Clipper on MS-DOS, whereby Clipper produces p-code while FlagShip a true native code. See also additional hints below. Q: The application consists of many modules, the resulting executable on DOS is approx. 1 MB while on Unix approx. 3 MB. A: There are many possible reasons. Generally: a.What you see as file size in the "ls -l" command is not the actual program size, but its size including the "comments" section and the linker/loader symbols, which are both not necessary for execution. To get rid of the linker symbols, you may use the $ strip see the Unix command "man strip". There is no way to get rid of the comment section, but it does not occupy memory during execution. To view the actual size of your executable, use the $ size Additional info: Unix command "man size". b.On DOS, the .EXE contains p-code only, whilst on Unix, native code is produced, which is approx. 2-3times larger (or even more on RISC systems). c.Compile by using the '-m' switch, e.g. FlagShip myapp*.prg -m Make sure, you are not adding any unused (dead) code, like test etc. when the shell evaluates the * wildcard. d.If you disable the debugger (the "-nd" option), the executable (and the code) will be several Kb smaller, see also manual sect FSC. e.Unix can handle executables up to 4 Gigabytes of size, even if no physical RAM memory is available, by using the "swap" partition as a "virtual RAM". Normally, there are no overlays on Unix. f.FlagShip 4.4 support dynamic linking for many systems. When using it, the file size is significantly smaller, usually some KBytes only. Q: Does the same FlagShip application occupy n-times the RAM memory when running it in multiuser or multitasking mode ? A: If several users are running the same application simultaneously, Unix uses the CODE only ONCE, while each user has his own DATA segment. Check the size of 'code' and 'data' segment by using $ size a.out The same applies also for dynamically linked applications. Q: When issuing the RUN command, the memory usage displayed with sar -r will sometimes be increased significantly. Why? A: The RUN command (and the similar system() C function) invokes a new copy of the shell, similarly to the COMMAND invocation in DOS. It has additi- onally to save the current Unix and program environment, to restore it upon return from the child process. Don't worry, Unix will manage it itself, in extreme cases by swapping (see above). ---- 7. Screen output ---------------------------------------------------- Q: On RedHat 8.x, I cannot get the PC-8 graphic chars displayed in terminal/console mode, although on other systems I have not such problems. A: RedHat 8.x use now Unicode charset for the (plain) terminal mode instead of the VGA/ASCII char set. You need to disable this in /etc/profile.d/lang.sh by commenting-out the following line to read: # unicode_start $SYSFONT $SYSFONTACM See further details in the Linux How-to's: zless /usr/share/doc/howto/en/Keyboard-and-Console-HOWTO.gz Q: When I recompile a Clipper application, I cannot see the full 255 char set used on PC or get colors in b/w only. A: Check your TERM or FSTERN environment variable. FlagShip supports the full IBM-PC char set and colors (assuming your terminal is able to display it). Set your terminal according to the FSmanual, sect REL (e.g. TERM=FSansi ; export TERM) or use the script newfscons a.out (or newfsterm ..., newfswin ...). See the Release Notes, "man fsman", "man flagship", and sections REL & SYS.2 in the manual for additional info. You may check the in/output with the supplied program [/usr/FSsrc/] fscheck.prg . Q: I notice slower screen output, compared to Clipper A: FlagShip uses Curses to be absolutely terminal independent, Clipper works on DOS hardware only. The Unix curses library updates ONLY the changed screen parts. In detail: a.As you know, Clipper writes directly into the video buffer (via direct hardware access), except when the ANSITERM.LIB plus GT.OBJ is used. You don't take notice of this, because you have only ONE operating system (DOS) running on ONE processor type (Intel) which can run only ONE program at a time and have only ONE choice of video card and terminal type (mono/color ANSI). You cannot use some Sparc, Risc, Cisc, Power chip, remote terminals etc.... b.Unix, as a real multiuser and multitasking system, does not allow you direct access and lowest-level modification on the hardware (thank goodness, you are surely familiar with hang-ups and breakdowns in MS-Windows, Windows-NT, OS/2 etc). The lowest communication level to the HW on Unix is a "driver", which is comparable and very similar to e.g. ANSI.SYS of MS- DOS. The mid-level terminal driver is the "curses" and "terminfo" (or the older, interpreted "termcap"). The real ADVANTAGE of the hardware independence is, you may run the same FlagShip application w/o recompiling it on virtually ANY local or remote terminal, console, X/Windows, via modem etc., by simply specifying the TERM environment variable. c.If you don't want to compare apples with oranges, make sure your CONFIG.SYS contains DEVICE=ANSI.SYS, then compile & link your applic on DOS with the ANSI driver (see above note a,b) by using: CLIPPER mymain /n /m CLIPPER myutil1 /n /m CLIPPER myutil2 /n /m RTLINK FI mymain,myutil1,myutil2,\clipper5\obj\gt LIB ansiterm and do the same on Unix: FlagShip my*.prg -Mmain -m -na You will then see the REAL FlagShip speed ! Q: How can I speed-up the screen output? A: When storing/restoring the screen contents, save it partially only, whenever possible; e.g. the sequence sVar := SaveScreen(10,30,15,60) ... RestScreen(10,30,15,60,sVar) is much faster than saving/restoring the whole screen, especially on slow remote terminal lines. When applicable, use DispBegin() before building a complex screen output, then perform the output by DispEnd() at once. Place the DispEnd() at latest just before the data input (e.g. before the READ, WAIT etc command). See also FS manual sect REL and SYS.2 for additional hints. Q: I noticed slower screen output in FlagShip compared to Recital. A: You're wrong. FlagShip allows the programmer to output data to the screen without having to worry about the point in time when this data will be displayed, since the display is handled synchronously with the execution of the corresponding .prg command or function. Recital however, does not offer this flexibility, and burdons the programmer additionally with having to define places in his program where the output to the display is required by having to use the FLUSH command. In FlagShip, if the programmer requires such behavior, it is absolutely under his control by using the DispBegin() and DispEnd() functions. When using these, you will observe that FlagShip performs MUCH better than Rectal also in this regard. You may add the line #command FLUSH => DispEnd() ; DispBegin() in your .prg or at the end of the std.fh file as well as add the line Flush at the beginning of your former Recital .prg application to start the DispBegin() collection. Q: When using TERM=FSansi on SCO Unix, the cursor remains visible also when SET CURSOR OFF is set. A: Disabling the cursor visibility depends on the Terminal, HW and Curses used. Usually, the curses provides the "civis" capability to make the cursor invisible. FlagShip uses "civis" on terminals which support it. The SCO Unix console terminal emulation follows the ANSI standard sequences. They have done a very good job at it too, except that ANSI "civis" in SCO's emulation does not work. Of course there is a way around it, which is also documented within /usr/lib/terminfo/FStinfo.src file provided with FlagShip, lines 171-174 for the FSansi terminal. If you remove the comment (#) sign from line 173 and "tic" the file anew (see also section SYS.2.3 in the FS manual), "civis" may work fine. Since this manipulates the cursor scan-lines, does not work with every OS release and HW, and is a work around after all, we felt it would be better to leave it to the user to decide (and test) whether to use it. Q: When I set TERM=fslinux, vi reports "unrecognized TERM type". Why? A: On Linux, vi (and some other programs) still use Curses with termcap instead of terminfo capability. Edit the /etc/termcap file, first executable statement, to read e.g.: console|fslinux|con80x25|dumb:\ ^^^^^^^^ The easier alternative is to use FSTERM instead of TERM (see FSC.3.3). Q: How can I avoid any output from FlagShip? A: In FlagShip 4.4, simply disable the curses according to section SYS.2.7. In FS4.3, use a "very dumb terminal" : create a file named e.g. /usr/lib/terminfo/dumb.src to read: #--------- # Dumb terminal which doesn't deliver any escape sequences, for use with # output to other programs, e.g. WWW # # Note: ignore the lots of warnings during the compilation. #--------- VeryDumbTerm|very dumb 80x24 terminal, w/o cursor & FN keys support, am, cols#80, lines#24, bel=^G, cr=\r, clear=, ind=\n, ri=, home=, cub1=\b, cud1=\n, cuf1=\ , sgr0=, blink=, bold=, rev=, civis=, cnorm=, enacs=, rmacs=, smacs=, smso=, rmso=, rmul=, smul=, #eof then compile it with tic [or tic181, tic194 on Linux, see Rel.Notes], e.g. "tic dumb.src" (see FS manual, sect. SYS) and set FSTERM=VeryDumbTern export FSTERM. This should work well also in background and via crontab; redirect to std output to /dev/null or other devices. Q: I noticed FlagShip supports German umlauts in X/Window xterm. How can I display or input (type in) my national characters in xterm or color_xterm (for Linux) ? A: Since most versions of xterm cannot display CHR(128..159) you have to remap these characters by modifying the following files: a.modify and compile the font file (msf*.bdf) and create a new font directory (/usr/FSsrc/xfonts), see FlagShip manual section REL - modifying fonts. b.The file /usr/lib/terminfo/FSchrmap.def has to be changed according to the modified font, see FS manual section SYS.2.4. c.For input use dead-key combinations. You sometimes have to additionally modify the xterm translations. See file /usr/bin/FSXTerm.xrd and "man xterm". The supplied /usr/bin/newfswin script sets usually the proper environment for you automatically, see details in fsman section REL or alternatively invoke less /usr/FSsrc/manual/relnotes.asc ---- 8. General ---------------------------------------------------------- Q: How long would you estimate for a good FoxPro/Clipper programmer to migrate to FlagShip programming ? A: Right away. There are a few differences between Unix and DOS that (s)he must consider and can read about in the FlagShip manual (see also below), but Xbase programming is entirely THE SAME. The goal of FlagShip is common source and data for both DOS and Unix. Porting existing programs depends on the programming style. Many customers report that NO changes at all were necessary for CA/Clipper 5.2 or Clipper '87 programs, and the port and test of several 100 thousand lines of source code was done within a few days (see also the SHORT.TXT file in the lib16 of GO FLAGSHIP forum on CIS, or ftp://fship.com/pub/multisoft/flagship/ docu/short.txt in Internet). People say, migrating to Unix with FlagShip is simpler than from Clipper'87 to Clipper 5. To be more specific: There are only three significant differences from your DOS program which your customer should consider (if they apply): a) Where manipulating DOS specific environment STRINGs (drive and path names, environment variables etc.) returned from DOSDIR() or GETENV(), the slight differences to Unix have to be considered. Changes can be done by use of #ifdef FlagShip preprocessor directive. The usual file access (also including path and drive) does not require any program changes, except one #include statement at the program beginning. b) The same is true for low-level MANIPULATION of the string returned by SaveScreen(). The usual invocation of the Save/RestoreScreen() command or function remains fully Clipper compatible. c) Using third party object libraries for DOS is, of course, not possible on Unix. Many of these libraries may simply be recompiled (if available in .prg or .c source code), or are already ported to FlagShip, e.g. the FS2 Toolbox is call-compatible to CA-Tools3. User-specific libraries will be simply recompiled on the target system. If none of the above applies, no changes at all are required in the appli- cation. FlagShip automatically handles DOS/Unix differences, i.e. DOS path and/or drive letters, the upper/lower case file name conversion, slash vs. backslash etc. when accessing the file, opening a dbf, searching for a file, reading a text file etc. Also all binary data (.dbf, .dbt, .mem, .txt, .lab, .frm) is vice-versa compatible with the DOS application. There is additional info available in /usr/FSsrc/docu/how-to* files and in the on-line manual fsman section LNG.9 Q: I noticed some small differences e.g. different run-time messages, not supporting some of the undocumented, internal Clipper functions etc. A: Please keep in mind, FlagShip is an independent programming language in its own right, and neither the Clipper nor the dBASE or Fox system (all of which are often not fully compatible to their own previous releases, work other than the documentation says and have several documented or undocumented anomalies). FlagShip supports very different operating systems from the MS-DOS. Our goal is to MAXIMIZE the portability and MINIMIZE your expense as much as possible. The remaining, very small differences in FlagShip are system dependent, and can be handled in your program. The differences between Unix and MS-DOS are summarized in the FlagShip manual (LNG.9), and, if any programming difference is noticeable, in the manual page of the command or function. Q: FlagShip 4.4 support the dynamic linking for the most operating systems. Where are the differences ? A: Only in the used libraries and the kind of compiling and linking. Your source code remains absolutely the same. You can - link statically; the required modules from the static library are then fully integrated into the executable. It is then sufficient to dis- tribute the executable file only. The executable may generally be exe- cuted on a wide range of (sub)releases of the same operating system. - link dynamically; the required modules from the dynamic library are loaded in RAM at run-time. Same as in the statically linked application, Unix loads the same code only once and uses it for concurrently used executables. But, as opposed to static libs, when you run different FlagShip applications at the same time, the system will also share common object modules (standard functions) available in the dynamic library (e.g. the GET, i/o or database system, etc.). The advantage of dynamically linked application are small executable files. Usually, there is no significant difference in the RAM require- ments or usage, since these modules also have to be loaded in the RAM. The disadvantage of dynamically linked applications is, that you have to distribute both the executable (e.g. a.out) and the FlagShip dynamic library (when the FlagShip Pro license is used). This may sometimes be dangerous, if your customer has FlagShip applications from different vendors, to install the supplied library for common use, when the other vendor uses a different FlagShip release... Moreover, the dynamically linked applications are usually not so widely compatible to other (sub) releases of the same operating system, as static applications are. So the decision to use the static or dynamic libraries is left to you depending on your needs and requirements. Generally, the best is to use dynamically linked applications in-house (or for well known customer's system) and to distribute the statically linked ones. Q: How can I create my own dynamic library ? A: Please check the FlagShip manual section FSC.1.7 for details. Keep in mind that access to PUBLIC and PRIVATE variables from modules included in your dynamic library (as opposed to the usual static library) is only possible via macros or by passing them via parameter list. Q: Is there any books on FlagShip other than your documentation? A: Not yet, but you may use any good Clipper 5.2 book, since FlagShip is syntactically and semantically fully compatible to it. Additionally, a good primer of Unix is recommended for Unix beginners, but not mandatory for using FlagShip and the created executables, since you get the same look-and-feel. The FlagShip manual (more than 1500 pages) includes a description of the system differences too. Q: Which RDD are included in FlagShip? A: FlagShip includes default RDD (replaceable database driver, named here DBFIDX), which is optimized for the Unix file access. In addition to, it allows data integrity checking (index vs. database), which avoids any possible "index file corrupted" errors. Additionally, you may use any other database/index/locking structure by using other RDD (replaceable database driver). However, FlagShip provides you with the mechanism, but does not include other RDDs (or database engines), similarly as FoxPro, dBase etc. does not. With other words: per default, you will use the FlagShip database engine, optimized for Unix. For special cases, you may optionally use also other RDDs, see details on http://www.fship.com/rdds.html Q: Are other RDDs available? A: There are currently 3rd party RDDs available for SQL and Cobol/Isam, both for free, based on this RDD mechanism, check the "Tools" button in http://www.fship.com, go directly to http://www.fship.com/rdds.html or visit your local /usr/FSsrc/tools directory. A RDD for CodeBase (supporting .cdx, .ntx, .ndx, .mdx etc.) is available in the distribution (read /usr/FSsrc/system/RDDcb4/README.CB4 for details). RDDs for Oracle, Ingres, Sybase, Informix, mySQL, PostgreSQL and other commercial or free SQL servers are available as well, see details on http://www.fship.com/rdds.html Q: May I create own RDDs? A: Yes. In the FlagShip distribution, there are examples available in both the .prg and/or .c source. One of these RDD examples allows you the full access to the CodeBase library, i.e. it supplies the connectivity between FlagShip (and other Xbase) statements and the C functions available in the CodeBase library for the access and locking of .cdx, .ndx, .ntx, .mdx etc. Q: Where are the differences between DOS and FlagShip database access? A: FlagShip's default RDD driver uses the standard Xbase databases, but does not support Clipper/Fox/dBase index and file/record locking scheme (it uses an Unix optimized ones). In addition to, FlagShip support data integrity checking, not available in other DOS based systems. Therefore, with the default RDD, you can access the same databases on DOS and Unix, but not simultaneously. Q: I lost my source code. Is a reverse engineering (as with Valkyrie for Clipper) possible also for applications created by FlagShip? A: No, it isn't (developer says: Thank God). As opposite to Clipper, FS does not produce p-code (which is not difficult to crack), but creates native objects (i.e. machine code). Neither the executable nor objects (.o, .a, .so) are reverse engineerable; an expert only may step thru the machine (or semi-assembler) code by using low level debugger (such as gdb, xdb, adb, sdb, cv) - without any possibility to reverse this code back to .prg source. If you lost the .prg, but have at least saved the from .prg produced .c files, you may use (and modify) the C code instead of the lost source; note that the code modification will then require C knowledge and is by far not so easy as with .prg source. So best to back-up your .prg & .fh sources (and the .dbf, .dbt data) frequently, as the minimal security. ---- 9. SCO Unix Notes (see also section REL in the manual) -------------- Q: When compiling C sources on SCO 3.2.5 with FlagShip 4.3, I get un- resolved externals, when the names (e.g. in the FlagShip library for SCO 3.2.2) exceed 32 characters. A: Use the FlagShip 4.4 port, or the mcc switch "-nl32" (i.e. FlagShip switch "-Wc,-nl32"). Q: Mathematical operations (division) using variables typed AS INT or AS LONG sometimes deliver unexpected results, but works absolutely perfectly with other types or in another environment. Why? A: The SCO 3.2.2 optimizer sometimes optimizes a little too much. In such a case, copy the /etc/FSconfig file to the local directory, and remove the "-CSON -Oxp" flags from PREOPTIONS. Q: Can I use executables created with "FlagShip for SCO 3.2.5 = OS5" also on earlier SCO versions (3.2.2 or 3.2.4) ? A: No, you cannot. The new SCO system use different type of object files (ELF vs. XCOFF). But you can use the FlagShip port for SCO 3.2.2 also for OS-5 systems. See details on http://www.fship.com/sco.html Q: When using "FlagShip for SCO 3.2.2-4" on SCO OS-5 (3.2.5) system, I get many errors during the link process. A: You have to use the backward compatible cc compiler available with SCO OS-5 named "mcc", which use the XCOFF object format compatible to the previous SCO releases. Activate the already predefined lines in the /etc/FSconfig file (see also fsman sect FSC.1.4.2) and deactivate the current setting (e.g. by using the comment mark # in col 1). ---- 10.Linux Notes (see also section REL in the manual) ----------------- Q: I have seen, there are now four different FlagShip ports for Linux available. Which port do I need? A: There are historically four major Linux systems available, which are unfortunately not fully compatible to each other. You may determine the proper FlagShip port according to description on http://www.fship.com/linux.html and select the required FlagShip (the free demo or licensed version) according to your Linux system... Q: Can I update my FlagShip for Linux (Libc based) to Glibc or Glibc-2.1? A: Yes, both the free test drive (demo) and the licensed version are available via http://www.fship.com/update.html. For an upgrade of your activation key, contact Q: Where are my umlauts after updating to SuSE 9.1? A: Similar to RedHat, SuSE changed in 9.1 the default console locales to Unicode (UTF-8), but the setup differs from RedHat. Best to invoke YaST -> System -> Language -> Details and disable the UTF-8 checkbox. Q: Can I use FlagShip with the Linux ELF version and 1.2.x or 2.x kernel? A: Yes, you can. FlagShip release 4.4x is ported for both the ELF and a.out versions of Linux. - FlagShip for Linux ELF allows you to build both dynamically or statically linked applications (executables) in ELF format. You may use this distribution only with the Linux ELF Kernel (1.2.13 and newer), and produce executables for Linux ELF systems. You are able to link dynamically or statically, at your choice. For the development, you will need gcc 2.5.8 or newer installed. See the description and requirements on http://www.fship.com/linux.html for the different ELF based Linux systems (Libc, Glibc and Glibc-2.1). - FlagShip for Linux a.out format allows you to build statically linked applications (executables) in the Linux format named "a.out" (NB this Linux naming convention has nothing common with the name of the execu- table :-). See also above info in section 8 about the differences between dynamic and static linking. Q: With Linux kernel 2.1.26 and newer, I get: "Linux OS is required.. ..(1021)" message even if the /proc file system is available and displays the correct date. A: Make sure you have /proc file system support in your kernel, check the "sysctl support?" or "proc filesystem?" setting when rebuilding the kernel. Q: I installed my xyz SlackWare Linux successfully, but FlagShip cannot execute and says "...Linux OS is required..." A: The release notes for Linux advise that the device "/dev/full" has to exist and that the "/proc" file system has to be installed. This is required for correct FlagShip functionality on Linux. To create "/dev/full" you may use (as super-user) # mknod /dev/full c 1 7 # chmod a+rw /dev/full For the "/proc" file system, you are prompted at the time of Linux installation. You may however reconfigure your Linux to add the "/proc" file system by using "cd /usr/src/linux; make config; ... " script. See more in the FlagShip manual, section REL and "man Configure" and the Linux documentation "recompiling the kernel". Q: The executable created by FlagShip runs fine for the root user, but displays "...Linux OS is required..." for others. A: Check the access rights to the /dev/full file and correct them with chmod to "rw" being su or root (chmod a+rw /dev/full). Q: On Linux, I get b/w output only, even on the color console. A: Linux distributions and releases vary heavily. The best is to use "newfscons ..." etc. or export TERM=fslinux (or FSTERM=fslinux, see Rel.Notes and sect. FSC). When using it, your application should act very similar to DOS (except for the ALT-keys). If the output of chr(0)...chr(31) is invisible, change the file /usr/lib/terminfo/ FStinfo.src (line 1404) to read # smacs=\E(B\E)U^N, rmacs=\E(B\E)0^O, smacs=\(B\E)U\E[11m, rmacs=\E(B\E)0^O, and execute (being su) #tic181 [/usr/lib/terminfo/]FStinfo.src (for Linux-a.out) or #tic194 [/usr/lib/terminfo/]FStinfo.src (for Linux ELF) You can regulate further mapping of characters in the file [/usr/lib/ terminfo/]FSchrmap.def if necessary, see sect SYS.2 in the manual. Q: When I try to execute an application via "newfswin ./a.out" in the X environment, I get a message "cannot find color_xterm" or similar. A: The color_xterm executable is not included in some distributions anymore. You may create a symbolic link (being su or root) cd /usr/X11R6/bin ln -s xterm color_xterm or modify the /usr/bin/newfswin script accordingly. In some cases, you will need to invoke "newfswin ; ./a.out ; exit" as described in the Release Notes of fsman. Q: A program compiled and linked with Libc5 runs only on systems with the same version of libraries? A: Statically linked executables will work on any Linux ELF system. Dynamically linked executables MAY work on newer systems, but it is not ensured by Linux, where the compatibility is set within the Libc or within the Glibc or within the new Glibc-2.1 based systems. Pls see additional details in http://www.fship.com/linux.html Q: I get a message "Error opening terminal: linux". The same happens in a window under X, but the message says "xterm" instead of "linux". A: You have not installed ncurses/terminfo on your system. But when invoking your application via - either "run ./a.out" - or "newfscons ./a.out" - or "newfswin ./a.out" as suggested in the /usr/FSsrc/doc*/how-to* and "man flaghip", it will work properly also without pre-installed terminfo. Q: Why I cannot get "." when using the numeric keypad? A: The scan code of numeric pad "." is different from the usual ".". The second may be mapped by the X11 or Linux keyboard driver to anything else (e.g. to comma ",") - check if both _really_ return dots. You will need to check/set the X11 or keyboard driver tables properly, see more in "man 5 keymaps", "man 1 loadkeys" or the keyboard how-to's. Q: I receive an error "/usr/bin/newfsterm: -e: command not found" when executing "newfsterm" script A: The reason seems to be a modified bash in some Linux distributions. You may download the fixed newfs* scripts for Linux from ftp://fship.com/pub/multisoft/flagship/support/rel44/ /update/linux-elf/newscripts.tar or via the "Support" button on http://www.fship.com/ page. Download binary and un-tar the file "newscripts.tar" in the /usr/bin subdirectory, i.e. su #if not root cd /usr/bin tar xvf /newscripts.tar exit #the su mode Q: After upgrading my Linux from RedHat 5 to 6 or 7 (or from SuSE 6..7), FlagShip reports several "undefined symbols" during the compilation. Also the old executables reports "segmentation fault" now. A: The compilation errors are from the Linux linker, not FlagShip itself. Linux versions are unfortunately object-incompatible to each other, see full details on http://www.fship.com/linux.html. You either need to link your application statically to be cross-compatible, or upgrade your FlagShip accordingly. You also will need the corresponding C compiler, see requirements on http://www.fship.com/linux.html Q: When I try to compile my first program by FS, an error message occurs: Installation problem, cannot exec 'as': No such file or directory A: FlagShip requires cc (gcc) which itself use assembler (as) and linker (ld). Both the last are available in the "binutil" package of your Linux distribution, installed ld & as are located in /usr/bin. Check your path (echo $PATH) if this directory is available there. Q: Am I bound to the GNU GPL (General Public License) when distributing my own package(s) compiled by commercial FlagShip? A: Neither FlagShip is, nor your application needs to be GNU GPL licensed, see the license on http://www.fship.com/license.html. But on Linux, your application will also use (in terms: is based on) the Linux libc.so library which is LGPL licensed. To consider this, please read carefully the LGPL license on http://www.gnu.org/copyleft/lesser.html or on http://www.fship.com/lgpl.html. Here the most important for you in short, non-lawyer wording (and hence w/o any legal liability ): 1.When your program displays Copyright notice, you also need to display "GNU libc.so (c) Copyright by Free Software Foundation Inc." 2.If your application is linked statically and distributed as such, you will need to provide a possibility to the end-user to re-link it with the latest or modified GNU libs, i.e. to enable him, upon request, the applic.objects (for at least three years) at no add.cost except S&H. (FYI: see also "Is a reverse engineering possible?" in section 8 above). 3.Para 2 does not apply if you distribute applications linked dynamically (the default), since the last/proper dynamic Linux libs (those the user already owns) are used automatically. You only will need to distribute the libFlagShip.so file with your application, see packaging details in section SYS.1.2 of the FlagShip manual (or in section 2 above). ---- 11.FreeBSD Notes ---------------------------------------------------- Q: Is a FreeBSD port of FlagShip available? A: Sorry, there is no FreeBSD port of FlagShip, since there are not enough requests to make this port cost effective (of course, customized port is possible). But you may compile your application on Linux, link statically and then execute it in your FreeBSD box. See additional details about the Linux compatibility in the FreeBSD Handbook chapter 20 (e.g. http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ linuxemu-lbc-install.html) - or an extract from, available on http://www.oreillynet.com/pub/a/bsd/2000/03/17/linuxapps.html or http://www.onlamp.com/lpt/a/bsd/2000/03/17/linuxapps.html Most probably, you will get a warning "Linux required..." at start-up of the application. This is harmless and can be avoided with the licensed FlagShip version, pls contact . ---- 12.Sun Solaris 2.5x Notes (see also section REL in the manual) ------ Q: Although the FlagShip and cc pass works fine, the linker reports a list of "symbol referencing errors", i.e. leaveok, noecho, winch, wscrl, init_pair etc. Why? A: These are symbols located in the Curses library (libcurses.*). Depending on your installation, the BSD curses library (located in /usr/ucblib) is preferred by the system, but FlagShip uses the AT&T compliant curses, which is usually located in /usr/ccs/lib. Simply add the -L option into the /etc/FSconfig file, line FSOPTIONS, to read e.g. FSOPTIONS: .... -L/usr/lib -L/usr/ccs/lib .... ---- 13.HP-UX Notes (see also section REL in the manual) ----------------- Q: During installation of FlagShip on HP-UX 10 and 11, the missing curses library is reported, but I am sure it is available. A: Some HP-UX releases use libHcurses.a instead of libcurses.a Simply ignore the warning during the installation and then change the /etc/FSconfig file (see details in fsman sect FSC.1.4.2) to read POSTOPTIONS:-lFlagShip -lHcurses -lmalloc -lm -lPW -s Q: On some HP-UX11 systems, the CD-ROM installation script "FSinstCD" reports syntax errors and exits. How to install FlagShip at all? A: HP uses several different sh binaries. You may either: a) if you know what you are doing, create a symb link /bin/sh -> ksh b) otherwise use the HD installation (go to /cdrom/tar and read the README there). After un-taring the two files into HD directory, change the first line of the FSinstCD file to read #!/bin/ksh and run ./FSinstCD there. ---- 14.GNU gcc notes for AIX and other systems -------------------------- Q: Does FlagShip run also with GNU C instead of the default C development package? A: Yes, in most cases, but without any warranty. For AIX you may download the ready to run GNU C package (and optionally the GNU debugger gdb) from e.g. http://aixpdslib.ucla.edu/categories.html or vial link from http://www.fship.com/tools.html. You will need to change the file /etc/FSconfig line PREOPTIONS to read PREOPTIONS:-DFGSAIX -DNLS -fwritable-strings ---- 15.Year 2000 -------------------------------------------------------- Q: Which changes in a FS application are required for the year 2000? A: FlagShip rel. 4.4x is automatically Y2K compliant. For older versions, add the SET EPOCH TO 1951 statement at the begin of your application - that's all. In detail: FlagShip stores the date always with the full century and supports date ranges from 1-Jan-01 to 31-Dec-9999. On 1-Jan-2000 the Date() function automatically returns the system date of 01/01/2000. When displaying and entering date in long format (YYYY), no changes are required. When only the short format (YY) is used, the (added) century depends on the SET EPOCH setting. You may: a: preferably at the begin of your main program, insert IF Year(Date()) >= 2000 // depends on the system date SET EPOCH TO 1951 // the default is 1900 ENDIF SET CENTURY ON // display in long format, if required The "SET EPOCH TO 1951" statement will set the year to 20xx when "00" and higher is entered and to 19xx when "51" or higher is given. This meets the BSI regulation (see http://www.fship.com/y2k.html). b: To meet this international standard just now, i.e. to implicit the 2000 century for entries <= 50, simply set SET EPOCH TO 1951 at the begin of your application (w/o the IF..ENDIF). This is now the default behavior in FS releases 4.42.448 and above. c: when a PICTURE clause is used for date values in @..SAY, @..GET or Transform(), you may preferably change it accordingly to display four digits of the year to make it absolutely clear to the user, e.g. @...GET mydate PICTURE "##.##.####". However. this depends on your screen design and requirements. d: The Ctod(), Dtoc(), Stod() and other translating functions will work w/o modification. Check (grep) your application for a possible redefinition of SET EPOCH, SET CENTURY and SET DATE FORMAT. e: For storing and manipulating date values, use the default DATE type instead of transferring it to CHAR or NUM values. This will avoid any headache later. See also the full Y2000 document on http://www.fship.com/y2k.html ---- 16.Support ---------------------------------------------------------- Q: How can I reach your support department ? A: Please contact your local dealer or distributor _first_ . They will mostly be able to answer all your questions. If a local distributor is not available, you may contact multisoft directly via e-mail, phone or fax. For easy handling, use preferably the "Support Request" form (see http://www.fship.com/support.html); otherwise always specify: a. Your FlagShip serial number (or Demo), check with "a.out -FSversion" b. The used Unix system, check with "uname -a" c. The environment used, use "env" (or at least "echo $TERM") d. Describe your problem or question (compiler, run-time, in/output etc). e. Include a _small_ and _compilable_ example of source code (and data or your own #include files, if any) to be able to reproduce your problem (max 50-100 lines when using e-mail, max 10 lines when using fax), specify your compiler flags. Describe how to produce the problem, if required. Test your example yourself before sending it. Don't pass the source and/or data in separate files, but add all in one tar file (best compressed/gzipped tar, e.g. "tar cvzf myprobl.tgz my*.prg my*.db*") and pass it as a binary e-mail attachment. Please use e-mail for support requests instead of fax whenever possible, since it is more comfortable, faster and clearer in context and doesn't require to retype your questions - or even program code. Please register your FlagShip (i.e. fill in and forward the /usr/FSsrc/REGCARD file) to take advantage of our support, and to receive new info automatically. The FREE support is available for registered users only. See additional details on http://www.fship.com/support.html Q: I have download the "Free Personal FlagShip". Where can I get support? A: The installation support is for free, pls refer to the e-mail with your activation key. But you surely will understand, that we cannot support the gift package for free as well. We grant 6 months free tech support for commercial FlagShip licensees. Users of the "Free Personal FlagShip" can obtain support on paid basis, see further details on http://www.fship.com/support.html. Of course, this does not affect possible bug reports to which we always appreciate. Q: Where can I get the upgrade of FlagShip 3.x or 4.3 to 4.4 ? A: If you purchased your FlagShip license within the last 6 months, you will get a free upgrade from your dealer/distributor, when you have registered it. Otherwise discounted upgrades are available, contact for details. Q: I have seen, there is a /pub/multisoft/flagship/support/rel44/update directory on your ftp server. Can I upload and install the files there? A: If you own a FlagShip 4.4x license (FlagShip Pro or Personal FlagShip), check this directory for free updates. But you cannot use it with FlagShip 4.3x (see the .../rel43 directory instead) or earlier, you will need to obtain an upgrade of your activation key. Q: How can I determine the used CC version? A: It depends heavily on the used system and compiler. The usual syntax is e.g. "cc -v", "cc -V", "cc --version" or via the packaging software. See system dependent details at the end of Release Notes: in the REL section of the on-line manual "fsman", in the corresponding ascii file /usr/FSsrc/manual/relnotes.asc, or on the CD-ROM /cdrom/relnotes.html Q: Any known anomalies ? A: See the appendix of the on-line manual (section APP) and the latest info about known anomalies on http://www.fship.com or directly on the ftp server ftp://www.fship.com/pub/multisoft/flagship/support/rel44/ anomaly.txt or .../support/rel44//update/anomaly.txt, if there. ----------------------------- ~| |) -------------------------------- multisoft Datentechnik GmbH ~~|) |)) Telephone (+49-89) 649-0040 POBox 312 |)) |))) Fax (+49-89) 641-2974 82027 Gruenwald/Munich ========/ E-mail support@fship.com Germany \ / Internet http://www.fship.com ---------------------------- ~~~~~~~~~~ ------------------------------- .