Part of Templates and the Application Generator: the hub. 68 entries under this heading; every entry opens as its own topic.
- How to make a template set a derived FileManager class for all files - Set a derived FileManager class for every file from your own template with an ATSTART loop over the files calling SetClassItem and the base class symbols.
- Window Manager is missing under Local Objects, ABC Objects in the Embed Tree - The missing Window Manager embeds mean a Legacy-chain app; there is no known conversion, so rebuild on the ABC chain or work in the Embeditor Source.
- Messaging templates: parameters for AddAttachment to attach an ASCII text file - AddAttachment takes file path, attachment name, content type, subtype and encoder; for plain text use Content:Text, SubType:plain and PlainEncoder or QuotedPrintable.
- The QBE form inherits the look of the browse that called it; how to change that - The QBE form takes the look of the calling browse; the poster who fixed it edited the QBE class source, as most variables are private. The Contains question went unanswered.
- Temporarily disabling the relationship manager in an update form to save an orphaned child record - To save orphan child records skip the ABC save with PUT in TakeCompleted, use an alias without the relation, zero the parent field, or a local RelationManager.
- How do I extract all the text strings of an app to a file for translation (ExtractText)? - Assign a file name to the Translator class's ExtractText after init and run through every procedure to write all texts to a file.
- A form says "An error was experienced during the creation of a record. File: Stock Error: %u ()." - The "%u ()" text is an unreplaced %ErrorText token from FileManager.InsertServer's unhandled-error case; the poster's cure was exporting the dictionary into a new one and a new app.
- A message() in the Error Manager TakeUser embed of a multi-DLL app never appears - A message() in the Error Manager TakeUser embed of a multi-DLL app stayed silent; the replies pointed to the tutorials and ErrorClass articles, with no direct fix.
- Moving a single-user ABC app (TPS) to four concurrent users on a LAN: what to change? - Templates and classes already handle multiple users, so check your own embed code and the Programmer's Guide multi-user chapter; on an NT LAN turn off opportunistic locking.
- Translating an application to other languages when many strings live in embedded source - For strings in embedded source, add your own messages to the Error Handler class message list, or use a third-party translation template; no outcome reported.
- Making an ABC browse locator reset after a pause in typing without editing the ABC classes - Derive your own locator class from the shipped ABC one instead of editing it, so patches stay safe; a timer-based example class was posted.
- "GEN:ASSERT: %GetBaseClassType: ClassItem has no instance" opening global embeds after adding a table - Refresh the Application Builder Classes in global properties; it must be repeated per app and per added table, and a PTSS report was filed.
- Replacing the cryptic referential integrity delete error message with a friendlier one - Override the message with the ErrorManager AddErrors and RemoveErrors methods; the texts are in AbError.trn, and no embed reaches the FileManager code.
- Is there an ABC property that tells whether a file is open (the Legacy Filename::Used)? - The open count in the FileManager Info is private; call STATUS() on the file (current thread only) or add a public method returning Self.Info.Opened.
- Keeping a class in step with a file's record buffer after every read and before every write - Derive from FileManager and override Insert, Update, Fetch, Next and Previous to call a virtual SyncBuffer; VIEWs and RelationManager bypass those methods.
- Changing the TopSpeed megafile name at run time for 96 tables: SetName in Program Setup is ignored - Name the table in the dictionary as an exclamation-prefixed variable and build each path from one base name at run time; SetName needs a variable name, PROP:Name was another suggestion.
- "Syntax error: Field not found: LISTCONTROL" for BRWx.ListControl in an embed after moving from Clarion 4 - Since the 5.5 interfaces BrowseClass has no public ListControl; use BRWx.Ilc.GetControl(), and in EIPManager methods Self.ListControl holds the browse list field number.
- Converting an app to Clarion 7: "ASSERT: %FixClassName: Cannot find class" and "Error(3): cif$fileopen .CLW" - Fix the "Directories scanned for ABC Classes" path in Tools, Options, Versions so it matches the install folder, here libsrc\win rather than win32.
- Can an app whose application template is Clarion (legacy) be changed to ABC? - Export to TXA, swap Clarion for ABC, rebuild the app, review the embeds and switch file-driver calls to ACCESS objects; third-party templates vary.
- "Assertion Failed on line 480 in file ABFILE.CLW: You are calling CLOSE(file) instead of FileManager.Close()" - The ABFILE assert means code closes a FileManager table directly; search generated source or an exported TXA for the CLOSE call and remove it.
- What is the ABC way to call a lookup procedure from hand code (SELF.Run(1,SelectRecord))? - The legacy GlobalRequest and GlobalResponse call still works in ABC; the Run number is a position in an EXECUTE list that can shift unnoticed.
- Every module recompiles on each build: "Making ModuleName.obj (Class_EventReport.inc changed)" - Every module recompiling came from similarly named class files whose short object names collided; renaming one class INC and CLW file to differ early stopped the full rebuilds.
- Where are the global File Manager and Relation Manager embeds documented, and when do you use which? (Reported, not reproduced) - Asked where the global File Manager and Relation Manager embeds are documented; replies only pointed to ABC reference chapters, and the delete and LOGOUT questions went unanswered.
- ASSERT "%BaseClassToUse: Symbol %DefaultBaseClassType is being returned empty" during generation (Reported, not reproduced) - Assert about an empty default base class appeared at random; guesses were a class added without a default or ActiveX controls; full regeneration cleared it.
- Reusing a module written with the ABC templates in an app built with the Legacy templates - An ABC module expects Access and Relate file objects a Legacy app lacks; compile it in its own app as a DLL and declare its procedures external.
- Making an app use a modified ABError.clw, or a derived error class, in a large multi-DLL app (Reported, not reproduced) - Redirected ABError copies were ignored; add the folder to the ABC scanner or derive the error class, which worked in a small app but not the multi-DLL one.
- Relate:Table.Open gives "invalid filename" (error 45) for tables of one MS SQL database only (Reported, not reproduced) - Relate Open gave invalid filename 45 for one MS SQL database; traces showed alias use, fresh generation was suggested, and no cause or outcome was reported.
- "Connection is busy with results for another hstmt" after upgrading to SQL Server 2008 with MARS on (Reported, not reproduced) - The busy-connection error with MARS on SQL 2008 occurred mostly in PrimeAutoInc; posters suggested switching MARS off in the driver string or the SQL 2005 native client; no outcome.
- ABC "Defer opening files until accessed": does turning it off give the Legacy open-everything behaviour? - The defer option controls whether RelationManager.Open also opens related tables; it defaults ON to keep Legacy behaviour, so leave it; hand-opened files need UseFile after Access Open.
- How to use the Source Class template that creates a class inside an app - The source class template works like a source template; set the module name to the class name, add a dummy procedure if asked, include its generated CLW and INC elsewhere.
- The Clarion email template does not show an embedded image in the message (Reported, not reproduced) - An image tag in the HTML message variable showed the image for one poster but not the other; no cause was found.
- Why does the generator write Relate:File.Open instead of Access:File.Open, and "file not open" on the first run? - Relate.Open equals Access.Open plus UseFile on the primary file; hand-coded file access needs Access.UseFile, and the poster fixed his case by setting the name before opening.
- RTF text control: Save() shows a Windows Save dialog although the file name is known - The RTF control forgot its file name after FindAndReplace, so Save() showed a dialog; the poster did the replaces on a string and called Load() again.
- Recreating a TPS file that returns error 47 at startup from a global embed gives an ABC file manager assertion - Assertion when recreating a bad TPS file from a global embed: file names set by variable are empty that early; open files only after initialisation.
- Clean Clarion 6 install: vsDate class and File Synchronization class compile errors although the add-on templates are registered (Reported, not reproduced) - After a clean install, vsDate and File Synchronization class errors stayed although the add-on templates were registered; the cause was never found.
- A widget copied from the iDash demo app gives compile errors about Self.Trace - A copied iDash widget class lacked the Trace method; derive the widget class from the iDash base widget class, which includes it.
- Importing procedures from a Clarion-chain app into an ABC app fails with "different chain" - Procedures from a Clarion-chain app refused by an ABC app as a different chain: export a TXA, change FROM ABC to FROM Clarion, import.
- Using an ABC-compliant class with a wrapper template in the Clarion chain, multi-DLL (Reported, not reproduced) - ABC class in a Clarion-chain multi-DLL app: enable ABC classes and export from the data DLL; the poster's template still gave ERRORCLASS errors.
- ABCFree ProcessQuietTakeNoRecords gives "Syntax error: Invalid use of PRIVATE data" - Remove the PRIVATE attribute on OpenFailed in the report include file, or RETURN in TakeNoRecords, or use the ReportQuiet template that changes the error's fatality instead.
- Own SMTP class built from the Messaging template code only works if the template was once added to the app - A hand-built SMTP class only worked after the Messaging template had been added once; copying the template's project defines fixed ABC, while a Legacy memory error stayed open.
- An ABC app using ODBC stays in the Task Manager process list after it is closed - An ABC ODBC app lingering in Task Manager after exit: disconnect from the database before ending, or as a stopgap end the code with HALT(0).
- Changes made in a second window revert to the old value after ThisWindow.Run(), even after Access:File.Update() - Changes in a second window reverted after Run despite Update; adding Access.UseFile(UseType:Returns) in the child window after the file opens kept them.
- GlobalErrors.LogErrors = True fails to compile with "invalid use of private data" - LogErrors is private, so do not assign it; call GlobalErrors.SetLogErrors(true) in the Program Setup global embed instead, with parentheses and a parameter.
- CRC32 of the record changes every time the form is saved, and how to detect a changed record - The stored CRC field is part of the record, so clear it before calculating; or compare the form buffer with SELF.Saved via EqualBuffer in the OK embed.
- Is there a procedure extension that saves and restores local variables in the INI file? - A third-party extension saves local variables through the INI manager, procedure name as section and variable name as key; a Procedure-name:Local section name avoids clashes.
- SelfService GetServiceStatus() gives compiler errors when called - Declare a group based on SS_SERVICE_STATUS in the procedure's Local Data and pass it to GetServiceStatus; a missing status group caused the compiler errors.
- Office template (Excel) fails with "Symbol %DefaultBaseClassType is being returned empty" after moving to Clarion 10 (Reported, not reproduced) - Office Excel template asserted that %DefaultBaseClassType was empty on Clarion 10; redirection paths, class refresh and compile settings were suggested, with no outcome.
- Writing a related file in TakeCompleted after the parent call: is the form's transaction closed, and what does Level:Benign mean? - The form's logout and commit sit inside the relation manager methods; Level:Benign means the first write succeeded; use TransactionManager or a window with LOGOUT for both files.
- Overriding an ABC method such as CancelAutoInc: how to see the default code, and what to do when the data is private - Read the default method in the ABC source; when class data is private, remove the PRIVATE attribute in the include file (keep a backup) or write your own class.
- Does one dictionary trigger cover both Update and TryUpdate (and Insert and TryInsert)? - One dictionary trigger covers Update and TryUpdate through the PRE and POST methods; embed in each method only if you embed directly into them.
- Returning a SQL aggregate (COUNT) through a dummy ODBC file works on Access but not on SQL Server - A COUNT through a dummy ODBC file needs debug mode off or the file in global embeds, plus an owner string matching the file's driver.
- How can embed code tell whether the app is ABC or Legacy, to use the file manager class only when present? - Key COMPILE and OMIT blocks on the equate FileClassPresent to tell ABC from Legacy in hand code; the %ABCversion symbol gave an unknown variable.
- Where do I translate the English messages that ABC templates generate (Cancel, save changes, Yes/No)? - The ABC message texts live in translatable ABERROR.TRN and WBHOOK.TRN files, and an article series on the ErrorClass covers translation.
- Template code using SELF.Errors.Id gives "invalid use of private data" after moving from Clarion 6.0 to 6.1 CR3 - Template code reading SELF.Errors.Id fails because it is private data; call a public getter such as GetErrorBufferId instead, as the error class source shows.
- Auto-incrementing a key when adding a record from a source procedure in an ABC application - In an ABC app, add records with the file manager's Insert, which numbers the auto key through PrimeAutoInc and rolls back on failure; do not mix styles.
- SortHeader class on a hand-filled list box sorts numbers but not string columns - String columns on a queue-filled list sorted only after setting SortHeader NoCase to False; case-insensitive sorting needed a different class.
- A Clarion 9.1 EXE using the ABC Free NT Service template hangs after four or five hours (Reported, not reproduced) - A service using the ABC Free NT Service template hung after hours on Clarion 9.1 but not 6.3; no cause found, a separate service wrapper was used.
- A homemade ABC class cannot call the INIManager FETCH and UPDATE methods (and what !,EXTENDS means) - A homemade ABC class gets the global INI manager as an Init parameter, not an embed; the EXTENDS and FINAL comments control which methods become embeds.
- Closing the whole application from another procedure: the Legacy POST of CloseWindow to the frame thread does not work in ABC - The Legacy line posting CloseWindow to the frame thread failed in ABC; the CleanCloseDown global extension is the documented way to close the application.
- A third-party template demo app will not compile: "Procedure in parent CLASS has VIRTUAL mismatch" - The VIRTUAL mismatch error means a derived class declares a method differently from its parent; match the declaration exactly or use fixes copied into LibSrc.
- OK button on a plain ABC Window procedure never reaches Accepted or TakeCompleted - TakeCompleted runs only when the button is the window's OkControl; one poster instead tested the last selected control in the Kill method.
- Can the ADO and SQL templates be used in an old application, or mixed with an ABC browse? - The Clarion 6 ADO templates need the global ADO extension and a rewrite, since ADO bypasses the file manager; mixing ADO with ABC browses was advised against.
- Using FileManager (Access:File) on a file declared in an embed instead of the dictionary - A file outside the dictionary can get its own FileManager through the double Hide:Access declaration, or use hand-coded import code with SHARE and plain file commands.
- ABC form: replacing the "Index would not be unique (23000)" message with something helpful - Check Duplicate before the write and show your own message, or change the key description, or add an error with AddError and swap the id in ThrowMessage.
- How to tell whether a Clarion 6.0 application was built with the ABC or the Clarion (Legacy) templates - Look for ABC class names in the global DLL or EXE, or find a TXA or APP, which names the template family.
- Making all fields of a file "hot" in an ABC browse (or keeping the file buffer in sync with the view) - For TPS, call UpdateViewRecord in TakeNewSelection or set SelectWholeRecord to 1; a PROJECT-free VIEW swapped in at Init loads the whole record.
- A FileDrop's ResetQueue has not run yet in the window Init, so a local field cannot be set from it - At Init the open-window event has not fired yet; build the field in SetQueueRecord as a hot field, or move the code to Open after the parent call.
- How do I get the application name and procedure name into the ABC error log? - Use SELF.GetProcedureName() in the derived ErrorClass, COMMAND(0) for the application and the GetComputerName API; generated procedures set the name on entry and exit.