Program Error at GET

Program Error at GET

Postby cdmmaui » Wed Jun 29, 2011 6:22 pm

Hello Everyone,

I am getting an error message when user starts entering data at field. What can I do to correct?

Source Code
==========================================
function RunRpt()

local oDlg, oIco , ;
nItems := 0 , ;
nRow := 10 , ;
aSay1[10] , ;
aSay2[10] , ;
aVar1[10] , ;
aVar2[10] , ;
aGet1[10] , ;
aGet2[10] , ;
aCri1[10] , ;
nFormat := 1 , ;
nPortrait := 2 , ;
nDialog := 0 , ;
cText := '' , ;
oText

// Determine Criteria Items... DO NOT FORGET PDF/XLS and Portrait/Landscape
SELECT reportd
GO TOP
SEEK report->serial
IF FOUND()
DO WHILE ! EOF() .AND. ( reportd->serial == report->serial )

IF reportd->criteria
nItems++

// Say....Tag...
aSay2[nItems] := ALLTRIM( reportd->fieldname )
aCri1[nItems] := reportd->crittype

// Get 1...
DO CASE
CASE ('[D]' $ aSay2[nItems] )
aGet1[nItems] := reportd->last01d
CASE ('[L]' $ aSay2[nItems] )
aGet1[nItems] := reportd->last01l
CASE ('[N]' $ aSay2[nItems] )
aGet1[nItems] := reportd->last01n
OTHERWISE
aGet1[nItems] := reportd->last01c
ENDCASE

// Get 2...
IF aCri1[nItems] > 1
DO CASE
CASE ('[D]' $ aSay2[nItems] )
aGet2[nItems] := reportd->last02d
CASE ('[L]' $ aSay2[nItems] )
aGet2[nItems] := reportd->last02l
CASE ('[N]' $ aSay2[nItems] )
aGet2[nItems] := reportd->last02n
OTHERWISE
aGet2[nItems] := reportd->last02c
ENDCASE
ENDIF
ENDIF

IF (nItems>=10)
EXIT
ENDIF

SELECT reportd
SKIP
ENDDO
ENDIF
IF nItems>10
nItems := 10
ENDIF
nDialog := (nItems * 30) + 200

DEFINE ICON oIco RESOURCE 'WINFRT'

DEFINE DIALOG oDlg FROM 01,01 TO nDialog,500 TITLE ALLTRIM( report->reportname ) ICON oIco PIXEL

FOR nRptCri=1 TO nItems

// Field Label...
@nRow+2,010 SAY aSay1[nRptCri] VAR aSay2[nRptCri] PIXEL

// Get 1...
DO CASE
CASE ('[D]' $ aSay2[nRptCri] )
@nRow,099 GET aVar1[nRptCri] VAR aGet1[nRptCri] SIZE 35, 12 PICTURE "@D" OF oDlg PIXEL
CASE ('[L]' $ aSay2[nRptCri] )
@nRow,099 CHECKBOX aVar1[nRptCri] VAR aGet1[nRptCri] OF oDlg PIXEL
CASE ('[N]' $ aSay2[nRptCri] )
@nRow,099 GET aVar1[nRptCri] VAR aGet1[nRptCri] SIZE 50, 12 PICTURE "999999999.99" OF oDlg PIXEL
OTHERWISE
@nRow,099 GET aVar1[nRptCri] VAR aGet1[nRptCri] SIZE 50, 12 PICTURE "@!" OF oDlg PIXEL
ENDCASE

// Get 2 - Range...
IF aCri1[nItems] > 1
@nRow+2,152 SAY 'to' PIXEL
DO CASE
CASE ('[D]' $ aSay2[nRptCri] )
@nRow,159 GET aVar2[nRptCri] VAR aGet2[nRptCri] SIZE 35, 12 PICTURE "@D" OF oDlg PIXEL
CASE ('[N]' $ aSay2[nRptCri] )
@nRow,159 GET aVar2[nRptCri] VAR aGet2[nRptCri] SIZE 50, 12 PICTURE "999999999.99" OF oDlg PIXEL
OTHERWISE
@nRow,159 GET aVar2[nRptCri] VAR aGet2[nRptCri] SIZE 50, 12 PICTURE "@!" OF oDlg PIXEL
ENDCASE
ELSE
aGet2[nRptCri] := aGet1[nRptCri]
ENDIF
nRow += 15
NEXT nRptCri

// Format...
@nRow+12,010 SAY 'Report Format' OF oDlg PIXEL
@nRow,099 RADIO nFormat PROMPT "&XLS", "&PDF" OF oDlg PIXEL
nRow += 25

// Portrait or Landscape....
@nRow+12,010 SAY 'Orientation' OF oDlg PIXEL
@nRow,099 RADIO nPortrait PROMPT "&Portrait", "&Landscape" OF oDlg WHEN (nFormat=2) PIXEL
nRow += 35

@nRow, 069 BUTTON "&Print" SIZE 40, 12 OF oDlg ACTION MsgInfo( 'Create Report' ) DEFAULT PIXEL
@nRow, 124 BUTTON "&Cancel" SIZE 40, 12 OF oDlg ACTION oDlg:End() PIXEL

ACTIVATE DIALOG oDlg CENTERED



Error Message
==========================================
Application
===========
Path and name: C:\Winapps\cargo\reportw.exe (32 bits)
Size: 2,139,136 bytes
Time from start: 0 hours 0 mins 4 secs
Error occurred at: 06/29/2011, 13:18:11
Error description: Error BASE/1110 Argument error: SUBSTR
Args:
[ 1] = U
[ 2] = N 1
[ 3] = N 0

Stack Calls
===========
Called from: => SUBSTR(0)
Called from: source\rtl\tget.prg => TCLIPGET:OVERSTRIKE(1326)
Called from: tget.prg => TGET:KEYCHAR(810)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: tget.prg => TGET:HANDLEEVENT(1514)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(0)
Called from: reportw.prg => RUNRPT(744)
Called from: reportw.prg => (b)_REPORTW(89)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(0)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(0)
Called from: reportw.prg => _REPORTW(125)

System
======
CPU type: Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz 2533 Mhz
Hardware memory: 2048 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Compiler version: xHarbour build 1.1.0 Intl. (SimpLex) (Rev. 6195)
Windows version: 6.1, Build 7601 Service Pack 1

Windows total applications running: 70
1 MSCTFIME UI
2 Default IME
3 Start
4 CiceroUIWndFrame
5 cdm
6 Start menu
7 Task Switching
8 Network Flyout
9 TF_FloatingLangBar_WndTitle
10 IS DXB
11 CDM WinFrt Version 10.1 - ID: 001 - PRO CARGO USA
12 CDM WinFrt Version 10.1 001 - PRO CARGO USA (IAH)
13 Administrator: cmd
14 Multi-Edit - [C:\Winapps\cargo\reportw.prg]
15 Outlook Send/Receive Progress
16 LogMeIn - Remote Access and Desktop Control Software - Windows Internet Explorer
17 Microsoft Word
18 RE: Reconciliation - Message (HTML)
19 ViewDeferedNotifManager 0x0CC8 0x133C
20 TNOTIFThisThreadSink 0x0CC8 0x133C
21 0 Reminders
22 Auto Renewal Notice for Your CSCMP Membership - Message (HTML)
23 Google - Windows Internet Explorer
24 DDE Server Window
25 AXWIN Frame Window
26 Document6 - Microsoft Word
27 OutlookFbThreadWnd
28 MCI command handling window
29 Document42
30 Microsoft Outlook Social Connector
31 G2M Outlook Addin2
32 GDI+ Window
33 MobileMeOutlookAddinWindowPort
34 WMS ST Notif Window 00000CC8 0000133C
35 WMS Idle
36 OfficePowerManagerWindow
37 MS_WebcheckMonitor
38 RawInputDetectorCaptionForIPoint
39 mouse
40 AK_DISPATCHER_WINDOW_TITLE
41 BluetoothNotificationAreaIconWindowClass
42 HiddenFaxWindow
43 Media Center SSO
44 WinAMRestoreWnd
45 e80
46 ConnectionMgr notification sink
47 Timer notification sink
48 Battery Meter
49 Hsm sink window
50 Control
51 G2MShutdownWatcher
52 Backup/Copy Engine Event Notification Window
53 J2GDllCmd
54 HelperMsgListenerWnd
55 Sigmatel-IDT-SysTray
56 FortiTray Desktop
57 Jump List
58 Task Host Window
59 FortiTray Deamon
60 NvSvc
61 SYM_AVPAPP_WINDOW_NAME_{1BE293D4-E7AD-4314-B8C9-C088A7CC1E69}
62 FWSesAlWndTitle
63 Volume Notification Hidden Window
64 ccSvcHst
65 DWM Notification Window
66 %1 - Shortcuts
67 New Item
68 Type words to search for
69 Inbox - darrell.ortiz@cdmsoft.com - Microsoft Outlook
70 Program Manager

Variables in use
================
Procedure Type Value
==========================
SUBSTR
Param 1: U
Param 2: N 1
Param 3: N 0
Local 1: U
Local 2: N 0
TCLIPGET:OVERSTRIKE
Param 1: C "R"
Local 1: O Class: TCLIPGET
Local 2: U
Local 3: O Class: TCLIPGET
TGET:KEYCHAR
Param 1: N 114
Param 2: N 1245185
Local 1: O Class: TGET
Local 2: N 0
Local 3: N 0
Local 4: U
Local 5: U
Local 6: U
TWINDOW:HANDLEEVENT
Param 1: N 258
Param 2: N 114
Param 3: N 1245185
TCONTROL:HANDLEEVENT
Param 1: N 258
Param 2: N 114
Param 3: N 1245185
Local 1: O Class: TGET
Local 2: U
TGET:HANDLEEVENT
Param 1: N 258
Param 2: N 114
Param 3: N 1245185
Local 1: O Class: TGET
_FWH
Param 1: N 1245185
Param 2: N 258
Param 3: N 114
Param 4: N 1245185
Param 5: N 14
Local 1: O Class: TGET
DIALOGBOXINDIRECT
Param 1: N 4194304
Param 2: C "€ È€ û t I S D X B P
…  q S T A T I C P o r t o f D i s c h a r g e [ C ] € P c
2 r E D I T P ˜  s S T A T I C t o € P Ÿ
2 t E D I T P
% \  u S T A T I C R e p o r t F o r m a t P g  
v B U T T O N & X L S P g & 
w B U T T O N & P D F P
> G  x S T A T I C O r i e n t a t i o n P g 2 .
y B U T T O N & P o r t r a i t P g ? 3
z B U T T O N & L a n d s c a p e  P E U )
{ B U T T O N & P r i n t P | U )
| B U T T O N & C a n c e l "
Param 3: N 4524650
Param 4: O Class: TDIALOG
TDIALOG:ACTIVATE
Param 1: U
Param 2: U
Param 3: U
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: L .F.
Local 1: O Class: TDIALOG
Local 2: N 4524650
Local 3: U
Local 4: U
Local 5: U
Local 6: O Class: TDIALOG
RUNRPT
Local 1: O Class: TDIALOG
Local 2: O Class: TICON
Local 3: N 1
Local 4: N 85
Local 5: A Len: 10
Local 6: A Len: 10
Local 7: A Len: 10
Local 8: A Len: 10
Local 9: A Len: 10
Local 10: A Len: 10
Local 11: A Len: 10
Local 12: N 1
Local 13: N 2
Local 14: N 230
Local 15: C ""
Local 16: U
(b)_REPORTW
Param 1: O Class: TBTNBMP
TBTNBMP:CLICK
Local 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
Param 1: N 41
Param 2: N 26
Param 3: O Class: TBTNBMP
Local 1: U
Local 2: L .T.
TWINDOW:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 2687002
TCONTROL:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 2687002
Local 1: O Class: TBTNBMP
Local 2: U
TBTNBMP:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 2687002
Local 1: O Class: TBTNBMP
_FWH
Param 1: N 2687002
Param 2: N 514
Param 3: N 0
Param 4: N 2687002
Param 5: N 6
Local 1: O Class: TBTNBMP
WINRUN
Param 1: N 4524650
TWINDOW:ACTIVATE
Param 1: C "NORMAL"
Param 2: U
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Param 7: U
Param 8: B {|| ... }
Param 9: U
Param 10: U
Param 11: U
Param 12: U
Param 13: U
Param 14: U
Param 15: U
Param 16: U
Param 17: U
Param 18: U
Param 19: U
Local 1: O Class: TWINDOW
Local 2: U
Local 3: U
_REPORTW
Param 1: C "001"
Param 2: C "CDM-ADMIN"
Local 1: O Class: TWINDOW
Local 2: O Class: TFONT
Local 3: O Class: TFONT
Local 4: O Class: TFONT
Local 5: O Class: TMENU
Local 6: O Class: TWBROWSE
Local 7: N 1440
Local 8: N 870
Local 9: N 1440
Local 10: N 680
Local 11: C "Search for Report by"
Local 12: C "A. Report Name"
Local 13: C " "
Local 14: A Len: 1
Local 15: A Len: 3
Local 16: O Class: TICON

Linked RDDs
===========
ADS
ADT
ADSCDX
ADSNTX
DBF
DBFFPT
DBFBLOB
DBFCDX
DBFNTX

DataBases in use
================

1: REPORT RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
1 3 .F. .F.

Indexes in use TagName
=> reportname S1

Relations in use

2: => REPORTD RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
9 25 .F. .F.

Indexes in use TagName
=> serial+STR(column,11) S1

Relations in use

Classes in use:
===============
1 HASHENTRY
2 HBCLASS
3 HBOBJECT
4 TWINDOW
5 TCONTROL
6 TICON
7 TBRUSH
8 TFONT
9 TMENU
10 TMENUITEM
11 TBAR
12 TRECT
13 TBTNBMP
14 TMSGBAR
15 TMSGITEM
16 TTIMER
17 TSAY
18 TCOMBOBOX
19 TGET
20 GET
21 TCLIPGET
22 TWBROWSE
23 TSCROLLBAR
24 TDIALOG
25 TRADMENU
26 TRADIO
27 TBUTTON
28 ERROR
29 TREG32

Memory Analysis
===============
123 Static variables

Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Program Error at GET

Postby carlos vargas » Wed Jun 29, 2011 7:04 pm

el error indica que la variable que esta editando el get, no tiene valor asignado, y que esta en valor NIL
por favor valida que la variable en los get tengan valor.

en el codigo que muestras, la variable aVar1 es inicializada como un arreglo de 10 elementos, y por ninguna parte se mira que le asignes un valor.
solo se muestra el manejo del indice.

salu2
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1715
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Program Error at GET

Postby cdmmaui » Wed Jun 29, 2011 7:59 pm

Can you please translate?
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: byron.hopp and 31 guests