nxScribe - Multi language management application (ver 1.0.2)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Just tried (NT4 sp6 fr) : it crashed.srod wrote:Would you mind, when you've time, trying it on Win NT. It should run okay.
nxScribe.exe
Exception : violation d'accès (0xc0000005), adressse : 0x77f7754b
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Immediately after I started it.srod wrote:Hi,
did it crash immediately on running?
I didn't see any window.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Gnozal, would you mind trying the following test version on NT.
I've added on error support and so we should get some kind of report as to where and why it is crashing - it's worth a shot!
http://www.purecoder.net/nxScribeTEST.zip
Thanks.
**Edit : the egrid library uses the GradientFill() function which, as far as I can tell, is not shipped with either Win 95 and NT. However, if this is the problem then I do not understand why the Windows loader would not report a problem! We can test this though if I rip out all of the GradientFill() calls from the egrid library.
I've added on error support and so we should get some kind of report as to where and why it is crashing - it's worth a shot!

http://www.purecoder.net/nxScribeTEST.zip
Thanks.
**Edit : the egrid library uses the GradientFill() function which, as far as I can tell, is not shipped with either Win 95 and NT. However, if this is the problem then I do not understand why the Windows loader would not report a problem! We can test this though if I rip out all of the GradientFill() calls from the egrid library.
I may look like a mule, but I'm not a complete ass.
Right, my orginal suspicion!
The following zip contains just the short procedure which is throwing the error.
If you unzip the two files within to a folder and run the LoadLanguageFile.pbi program you should see exactly where the crash occurs.
Thanks I really appreciate your help here.
http://www.purecoder.net/nxScribeLanguage.zip
The following zip contains just the short procedure which is throwing the error.
If you unzip the two files within to a folder and run the LoadLanguageFile.pbi program you should see exactly where the crash occurs.
Thanks I really appreciate your help here.
http://www.purecoder.net/nxScribeLanguage.zip
I may look like a mule, but I'm not a complete ass.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
1. If English.nxScribelan is in the EXE directory, no error.srod wrote:Right, my orginal suspicion!
The following zip contains just the short procedure which is throwing the error.
If you unzip the two files within to a folder and run the LoadLanguageFile.pbi program you should see exactly where the crash occurs.
Thanks I really appreciate your help here.
http://www.purecoder.net/nxScribeLanguage.zip
Debug view outputs 'Author - Stephen Rodriguez'
2. If English.nxScribelan is missing in the EXE directory, it crashes at line 103 'NextDirectoryEntry(1)'
EDIT : if you use "*.*" as filemask, it doesn't crash.
Last edited by gnozal on Wed Oct 10, 2007 3:43 pm, edited 1 time in total.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Gnozal if I remove the lan file from the exe directory then the program crashes because of the IncludeBinary() statement, which makes sense because of the missing file. This is of course a compilation error rather than a runtime one.
The fact that on your system it crashes at a different point, at run time, indicates a problem with Win NT or PB itself.
This is strange.
I presume you've compiled with the debugger enabled?
Can you try this :
You are better off creating an exe when running this.
The fact that on your system it crashes at a different point, at run time, indicates a problem with Win NT or PB itself.
This is strange.
I presume you've compiled with the debugger enabled?
Can you try this :
Code: Select all
;'nxScribe'.
;===========
;Language file module.
Global Dim gLanguage$(0)
Enumeration ;Language strings.
#lan_application
#lan_author
#lan_builddate
#lan_language
#lan_Error
#lan_Terminating
#lan_GUIProblem
#lan_DuplicateIdentifier
#lan_NoGroupSpaces
#lan_NoIdentifierSpaces
#lan_FileNotFound
#lan_LanguageFile
#lan_AbortingProcedure
#lan_ttNewProject
#lan_ttOpenProject
#lan_ttSaveProject
#lan_ttSaveProjectAs
#lan_ttChangeSettings
#lan_ttLanguageFiles
#lan_ttGenerateSource
#lan_ttCloseProject
#lan_ttHelp
#lan_ttExit
#lan_ttShiftLeft
#lan_ttShiftRight
#lan_ttContextMenus
#lan_ttClickHeader
#lan_ttRemoveSelectedLanguages
#lan_ttAddRow
#lan_menuAddRow
#lan_menuInsertRowBefore
#lan_menuInsertRowAfter
#lan_menuDeleteRow
#lan_menuCutRow
#lan_menuCopyRow
#lan_menuPasteNewRow
#lan_gdLanguages
#lan_gdAdd
#lan_gdEdit
#lan_gdDelete
#lan_gdGroups
#lan_gdNoLanguageGroup
#lan_gdSelectedGroup
#lan_gdSelectedGroupEntry
#lan_gdSelectedGroupEntries
#lan_gdIdentifier
#lan_gdAddRow
#lan_gdCreateLanguageFiles
#lan_gdLanguagesFrame
#lan_gdAvailableLanguages
#lan_gdLanguageFilesToCreate
#lan_gdLanguageFileFormat
#lan_gdDestinationFolder
#lan_gdCancel
#lan_gdCreateFiles
#lan_CloseCurrentProject
#lan_NewGroupName
#lan_GroupNewName
#lan_GroupNameExists
#lan_OutOfMemory
#lan_DeleteGroup
#lan_DeleteRow
#lan_NewLanguageName
#lan_LanguageNewName
#lan_LanguageExists
#lan_DeleteLanguage
#lan_ProjectHasChanged
#lan_SelectSaveLocation
#lan_FileAlreadyExists
#lan_SelectProjectToOpen
#lan_ProblemOpeningProject
#lan_InvalidProjectFile
#lan_NoProjectOpen
#lan_NoLanguages
#lan_SelectAtLeastOneLanguage
#lan_Module
#lan_CreatedBy
#_languagfileeend
EndEnumeration
;Returns non zero if no error.
Procedure.l LoadLanguageFile()
Define blnTemp, languagefilename$, temp$, i, result, fileformat
Dim gLanguage$(#_languagfileeend-1)
;We need to scan the current directory looking for language files.
;If there are some, then we select the first found.
;Else, we unpack the default language file to a temporary location.
If ExamineDirectory(1,GetPathPart(ProgramFilename()),"*.nxScribelan")
If NextDirectoryEntry(1)
languagefilename$=DirectoryEntryName(1)
EndIf
EndIf
FinishDirectory(1)
If languagefilename$=""
languagefilename$=GetTemporaryDirectory()+"English.nxScribelan"
If CreateFile(1,languagefilename$)
blnTemp = #True ; Signify that we will have to delete the temporary file.
WriteData(1,?englanstart,?englanend-?englanstart)
CloseFile(1)
EndIf
Else
languagefilename$=GetPathPart(ProgramFilename())+languagefilename$
EndIf
;Now we need to load the language file into the language$ array,
If ReadFile(1, languagefilename$)
;Determine the format of the file.
fileformat=ReadStringFormat(1)
If fileformat<=#PB_Ascii ;Recongnised format.
While Not(Eof(1))
temp$=Trim(ReadString(1, fileformat))
If temp$<>"" And Left(temp$,1)<>";"
gLanguage$(i)=temp$
i+1
EndIf
Wend
result = 1
EndIf
CloseFile(1)
EndIf
If blnTemp
DeleteFile(languagefilename$)
EndIf
ProcedureReturn result
EndProcedure
;-Data section.
;******************************************************************************************
DataSection
englanstart:
IncludeBinary "English.nxScribelan"
englanend:
EndDataSection
LoadLanguageFile()
MessageRequester("",gLanguage$(1))
You are better off creating an exe when running this.
I may look like a mule, but I'm not a complete ass.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I compile 'LoadLanguageFile.pbi' without error (IncludeBinary works as English.nxScribelan is in the pbi's directory).srod wrote:Gnozal if I remove the lan file from the exe directory then the program crashes because of the IncludeBinary() statement, which makes sense because of the missing file. This is of course a compilation error rather than a runtime one.
The fact that on your system it crashes at a different point, at run time, indicates a problem with Win NT or PB itself.
This is strange.
Now, if I move the EXE to another directory without English.nxScribelan, it crashes.
Yessrod wrote:I presume you've compiled with the debugger enabled?
EDIT : same result (crash with the other code)
EDIT2:
So it works :
Code: Select all
If ExamineDirectory(1,GetPathPart(ProgramFilename()),"*.*")
While NextDirectoryEntry(1)
If LCase(GetExtensionPart(DirectoryEntryName(1))) = "nxscribelan"
languagefilename$=DirectoryEntryName(1)
Break
EndIf
Wend
FinishDirectory(1)
EndIf
Last edited by gnozal on Wed Oct 10, 2007 4:06 pm, edited 2 times in total.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
One last try then, following your "*.*" hint, can you try the following which is a bit of a rewrite :
Code: Select all
;'nxScribe'.
;===========
;Language file module.
Global Dim gLanguage$(0)
Enumeration ;Language strings.
#lan_application
#lan_author
#lan_builddate
#lan_language
#lan_Error
#lan_Terminating
#lan_GUIProblem
#lan_DuplicateIdentifier
#lan_NoGroupSpaces
#lan_NoIdentifierSpaces
#lan_FileNotFound
#lan_LanguageFile
#lan_AbortingProcedure
#lan_ttNewProject
#lan_ttOpenProject
#lan_ttSaveProject
#lan_ttSaveProjectAs
#lan_ttChangeSettings
#lan_ttLanguageFiles
#lan_ttGenerateSource
#lan_ttCloseProject
#lan_ttHelp
#lan_ttExit
#lan_ttShiftLeft
#lan_ttShiftRight
#lan_ttContextMenus
#lan_ttClickHeader
#lan_ttRemoveSelectedLanguages
#lan_ttAddRow
#lan_menuAddRow
#lan_menuInsertRowBefore
#lan_menuInsertRowAfter
#lan_menuDeleteRow
#lan_menuCutRow
#lan_menuCopyRow
#lan_menuPasteNewRow
#lan_gdLanguages
#lan_gdAdd
#lan_gdEdit
#lan_gdDelete
#lan_gdGroups
#lan_gdNoLanguageGroup
#lan_gdSelectedGroup
#lan_gdSelectedGroupEntry
#lan_gdSelectedGroupEntries
#lan_gdIdentifier
#lan_gdAddRow
#lan_gdCreateLanguageFiles
#lan_gdLanguagesFrame
#lan_gdAvailableLanguages
#lan_gdLanguageFilesToCreate
#lan_gdLanguageFileFormat
#lan_gdDestinationFolder
#lan_gdCancel
#lan_gdCreateFiles
#lan_CloseCurrentProject
#lan_NewGroupName
#lan_GroupNewName
#lan_GroupNameExists
#lan_OutOfMemory
#lan_DeleteGroup
#lan_DeleteRow
#lan_NewLanguageName
#lan_LanguageNewName
#lan_LanguageExists
#lan_DeleteLanguage
#lan_ProjectHasChanged
#lan_SelectSaveLocation
#lan_FileAlreadyExists
#lan_SelectProjectToOpen
#lan_ProblemOpeningProject
#lan_InvalidProjectFile
#lan_NoProjectOpen
#lan_NoLanguages
#lan_SelectAtLeastOneLanguage
#lan_Module
#lan_CreatedBy
#_languagfileeend
EndEnumeration
;Returns non zero if no error.
Procedure.l LoadLanguageFile()
Define blnTemp, languagefilename$, temp$, i, result, fileformat
Dim gLanguage$(#_languagfileeend-1)
;We need to scan the current directory looking for language files.
;If there are some, then we select the first found.
;Else, we unpack the default language file to a temporary location.
If ExamineDirectory(1,GetPathPart(ProgramFilename()),"*.*")
While NextDirectoryEntry(1)
If GetExtensionPart(DirectoryEntryName(1)) = ".nxScribelan"
languagefilename$=DirectoryEntryName(1)
Break
EndIf
Wend
FinishDirectory(1)
EndIf
If languagefilename$=""
languagefilename$=GetTemporaryDirectory()+"English.nxScribelan"
If CreateFile(1,languagefilename$)
blnTemp = #True ; Signify that we will have to delete the temporary file.
WriteData(1,?englanstart,?englanend-?englanstart)
CloseFile(1)
EndIf
Else
languagefilename$=GetPathPart(ProgramFilename())+languagefilename$
EndIf
;Now we need to load the language file into the language$ array,
If ReadFile(1, languagefilename$)
;Determine the format of the file.
fileformat=ReadStringFormat(1)
If fileformat<=#PB_Ascii ;Recongnised format.
While Not(Eof(1))
temp$=Trim(ReadString(1, fileformat))
If temp$<>"" And Left(temp$,1)<>";"
gLanguage$(i)=temp$
i+1
EndIf
Wend
result = 1
EndIf
CloseFile(1)
EndIf
If blnTemp
DeleteFile(languagefilename$)
EndIf
ProcedureReturn result
EndProcedure
;-Data section.
;******************************************************************************************
DataSection
englanstart:
IncludeBinary "English.nxScribelan"
englanend:
EndDataSection
LoadLanguageFile()
MessageRequester("",gLanguage$(1))
I may look like a mule, but I'm not a complete ass.