SBP ÿ½ FieldSelection() - A generic replacement for the internal FieldSelection (c)1994-1996 InterApps, Inc. ÿ½ ÿ½ This code was posted to show you how you can save and retrieve values ÿ½ for the FieldSelection dialog. ÿ½ ÿ½ You are hereby granted the right to freely use and distribute this code ÿ½ as you see fit provided the copyright notice remains intact in the ÿ½ source comments... ÿ½ ÿ½ When Who Why ÿ½ 941109 Mark Hripko Initial Version 1.0 ÿ½ ÿ½ Note that if the sum of the lengths of all fields selected is greater ÿ½ then 255, the INI file will truncate it. Thus, when you read it back ÿ½ in, it will generate an error. Therefore, don't save LARGE field ÿ½ selection, or modify this program so that it doesn't write to the ÿ½ ini file, or change the way it saves/retrieves the ini file data! ÿ½ ÿ½ Remember, it's only a sample... ÿ½ ÿÿmain() ÿƒFLDSEL() ÿ’ÿÿ ' ************************************************************************* ' * FLDSEL() - demonstrate how FieldSelection() works. ' * ' * Example : CALL FLDSEL() ' * Result : Allows you to interact with a field selection panel. ' ************************************************************************* ÿÿFLDSEL()  ÿ½ Make sure we have a file open for the demo. ÿ¡ÿ™ÿ""ÿpÿƒOpenFile() ÿ½ Now show them how it works... ÿƒFieldSelection() ÿ’ÿÿ ' ************************************************************************* ' * FieldSelection() - Show the Enhanced Field Selection panel ' * (This replaces the internal procedure.) ' * ' * (c)1994-1996 InterApps, Inc. and Mark Hripko ' * ' * GLOBAL = uses USERNAME to log preferences under your username. ' * GLOBAL = write to SB30.INI (user SUPERBAS.INI for version 2!) ' * ' * Example : Call FieldSelection() ' * Result : Allows you to interact with a field selection panel. ' ************************************************************************* ÿÿFieldSelection() ÿ¡ÿ™ÿ""ÿpÿ’ÿÿ ÿ½ Register the DLL calls. ÿîÿ… ÿî"Kernel","GetPrivateProfileString","ICCCFIC" ÿî"Kernel","WritePrivateProfileString","ICCCC" ÿ½ Show the current settings, and allow to change a%%ÿÿƒ("GetPrivateProfileString",ÿã,ÿ™ÿ":Field Selection","",lpKeyValue$,256,"SB30.INI") ÿ¡retval%%ÿ1ÿp ex$ÿ"OPEN FIELDS "ÿlpKeyValue$ ÿ–ex$ ÿ’ÿ¡  ÿ½ Show the Field Selection Dialog ÿ…ÿ& ÿÊÿ_ÿe11 ÿ´ÿ˜ÿ~ ÿÊÿ_ÿ³11 ÿ¡ÿ&ÿ11ÿp ÿ†ÿ˜:ÿÎ ÿ^ ÿÎ ÿ½ Read the values back into a variable... NumOpenFields%%ÿÿõ(ÿ™,2) ÿ×fieldsel$(NumOpenFields%%) ÿÿfieldsel$,2 lpKeyValue$ÿfieldsel$(0) ÿ›i%%ÿ1ÿqNumOpenFields%%ÿ1:lpKeyValue$ÿlpKeyValue$ÿ","ÿfieldsel$(i%%):ÿ±i%% ÿ½ Now update the NETINI file with the changes. a%%ÿÿƒ("WritePrivateProfileString",ÿã,ÿ™ÿ":Field Selection",lpKeyValue$,"SB30.INI") ÿ’ÿ¡ ÿ’ÿÿ