Compiler crash when calling Public Sub

Coding + IDE + Code-Editor + Syntax + User-Functions + Anything else

Compiler crash when calling Public Sub

Postby GaryVass » Tue Feb 28, 2012 7:13 pm

I have a public sub, mdeInputData.ImportIt(tDataTick As String) that crashes when called...

Not that the subroutine crashes, the program crashes and I get a message that windows is searching for a fix??

This sub is called within a set of code that is part of a routine called when a button is pushed on the menu screen.

I am at a loss as to why it crashes... I have tested the variable passed, it does have valid data which is something like "c:\directory\ticker"
GaryVass
 
Posts: 109
Joined: Wed May 04, 2011 8:03 pm

Re: Compiler crash when calling Public Sub

Postby Henning » Tue Feb 28, 2012 10:22 pm

Hi,

Just talking to myself....

What if you change "\" to "/"?
"\" is used as an Esc character to build ie. "\r\n" = Return + Linefeed. I guess "\t" could be expanded to Tab......

/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm

Re: Compiler crash when calling Public Sub

Postby GaryVass » Wed Feb 29, 2012 5:15 am

No dice... no change....
GaryVass
 
Posts: 109
Joined: Wed May 04, 2011 8:03 pm

Re: Compiler crash when calling Public Sub

Postby Slowdown » Wed Feb 29, 2012 7:59 pm

A module mdeInputData and in that module a public sub ImportIt(tDataTick As String) ?
if true are there gui related actions to MainWindow ?
If true than that is the real problem, if false i'm totally wrong and need more info. ;)
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: Compiler crash when calling Public Sub

Postby GaryVass » Wed Feb 29, 2012 9:29 pm

The only GUI part is the user clicks a button to start the process... there is no other gui interaction after that. All variables declared as Public, all subs declared as public. (the module is mdeInput.module, and the sub is Public Sub ImportIt(tDataTick As String) .... I named it wrong in the last post...)

This is the code for the button under MainWindow.QMainWindow :

Signal on_cmdSP500Data_clicked(Checked As Boolean)

SPMktCap = 0

'generate basic data in SPDATA1 recordset
strSQL= "DELETE FROM SPDATA1;"
rslt = Query.Run(strSQL)

If rslt = 0 Then
MsgBox("Warning1", "Error: Table SPDATA1 was not cleared")
End If


strSQL= "DELETE FROM SPVal;"
rslt = Query.Run(strSQL)

If rslt = 0 Then
MsgBox("Warning1", "Error: Table SPVal was not cleared")
End If

strSQL = "SELECT * FROM SPTIC ORDER BY TIC;"
sRecordsId = Records.Open(gsDatabase, strSQL)

stocknum = (Records.Length(sRecordsId))
rGo2= 0

REPORT = "SPDATA1"



Do While stocknum > 0
DFoundIt = 1
Records.GoTo(sRecordsId, rGo2)

DataTick = Records.Value(sRecordsId, "TIC")
sSector = Records.Value(sRecordsId, "SECTOR")
sSPCode = Records.Value(sRecordsId, "SPCode")
rGo2= rGo2 + 1
GetData(DataTick)
sdir = "c:/naic/"
filename = sdir + DataTick + ".ssg"
MsgBox("filename:", filename)
tDataTick = filename

mdeInput.ImportIt(filename) THIS IS WHERE THE CRASH OCCURS, AS SOON AS THIS IS CALLED. I PUT SOME MSGBOX IN THE SUB JUST AT THE BEGINNING, BUT THEY ARE NEVER DISPLAYED, SO I DONT THINK THE CODE ACTUALLY GETS TO THE SUB ROUTINE
MsgBox("dataList:", dataList)
MsgBox("DFoundIt = ",DFoundIt)

If DFoundIt = 1 Then
mdeDataImport.StockData(filename, REPORT, DataTick)
stocknum = stocknum - 1
End If
Loop
GaryVass
 
Posts: 109
Joined: Wed May 04, 2011 8:03 pm

Re: Compiler crash when calling Public Sub

Postby GaryVass » Thu Mar 01, 2012 5:33 pm

Ok,

Found the error... it was a stupid programmer error :oops:

In other parts of the program the data is read into the dataList list object, but in the part I was working on, it was not read into the list object and the one subroutine was trying to parse an empty list....
GaryVass
 
Posts: 109
Joined: Wed May 04, 2011 8:03 pm

Re: Compiler crash when calling Public Sub

Postby Slowdown » Thu Mar 01, 2012 7:57 pm

it was a stupid programmer error :oops:

That same error i also find many times in my code :P
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: Compiler crash when calling Public Sub

Postby Henning » Thu Mar 01, 2012 9:19 pm

Must be some sort of a pandemi, I also get that error... ;)

/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm


Return to Questions & Answers

Who is online

Users browsing this forum: No registered users and 0 guests

cron