Basic help

EXTRA basic macro help

Page 1 of 1

6 Replies - 1176 Views - Last Post: 17 December 2008 - 02:47 PM Rate Topic: -----

#1 cheetahz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-December 08

Basic help

Post icon  Posted 05 December 2008 - 07:46 AM

hi, i am trying to get this program to run a snipit of code if the checkbox is check and not run it if it is not checked.

checkbox has 18 options it looks fine but runs the code checked or un-checked i need some kind of if then else statement but i an a newbie and cant figure it out?
this is not visual basic i am sure you know but this is EXTRA basic marco editor from a mainframe
but since the coding is simular and i cant seem to find help i came here?

i hope you can help me out here, thanks


' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$

Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
	Dim Sessions As Object
	Dim System As Object
		
	Set System = CreateObject("EXTRA.System")	' Gets the system object
	If (System is Nothing) Then
		Msgbox "Could not create the EXTRA System object.  Stopping macro playback."
		STOP
	End If
	Set Sessions = System.Sessions

	If (Sessions is Nothing) Then
		Msgbox "Could not create the Sessions collection object.  Stopping macro playback."
		STOP
	End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
	g_HostSettleTime = 400	' milliseconds

	OldSystemTimeout& = System.TimeoutValue
	If (g_HostSettleTime > OldSystemTimeout) Then
		System.TimeoutValue = g_HostSettleTime
	End If



   
'Dim CheckBox1() as Integer
'ReDim CheckBox1(0)

'Dim CheckBox2() as Integer
'ReDim CheckBox2(0)

'Dim CheckBox3() as Integer
'ReDim CheckBox3(0)

'Dim CheckBox4() as Integer
'ReDim CheckBox4(0)

'Dim CheckBox5() as Integer
'ReDim CheckBox5(0)

'Dim CheckBox6() as Integer
'ReDim CheckBox6(0)

'Dim CheckBox7() as Integer
'ReDim CheckBox7(0)

'Dim CheckBox8() as Integer
'ReDim CheckBox8(0)

'Dim CheckBox9() as Integer
'ReDim CheckBox9(0)

'Dim CheckBox10() as Integer
'ReDim CheckBox10(0)

'Dim CheckBox11() as Integer
'ReDim CheckBox11(0)

'Dim CheckBox12() as Integer
'ReDim CheckBox12(0)

'Dim CheckBox13() as Integer
'ReDim CheckBox13(0)

'Dim CheckBox14() as Integer
'ReDim CheckBox14(0)

'Dim CheckBox15() as Integer
'ReDim CheckBox15(0)

'Dim CheckBox16() as Integer
'ReDim CheckBox16(0)

'Dim CheckBox17() as Integer
'ReDim CheckBox17(0)

'Dim CheckBox18() as Integer
'ReDim CheckBox18(0)




	Begin Dialog cbdlg 228, 150, 221, 287, "Mastercard Chargebacks and fraud reporting"
   ButtonGroup .bg
   OkButton  141, 67, 50, 14
   CancelButton  141, 109, 50, 14
   CheckBox  0, 0, 40, 10, "LINE1", .CheckBox1
   CheckBox  0, 14, 40, 10, "LINE2", .CheckBox2
   CheckBox  0, 30, 40, 10, "LINE3", .CheckBox3
   CheckBox  0, 47, 40, 10, "LINE4", .CheckBox4
   CheckBox  0, 61, 40, 10, "LINE5", .CheckBox5
   CheckBox  0, 78, 40, 10, "LINE6", .CheckBox6
   CheckBox  0, 95, 40, 10, "LINE7", .CheckBox7
   CheckBox  0, 113, 40, 10, "LINE8", .CheckBox8
   CheckBox  0, 132, 40, 10, "LINE9", .CheckBox9
   CheckBox  0, 150, 40, 10, "LINE10", .CheckBox10
   CheckBox  0, 166, 40, 10, "LINE11", .CheckBox11
   CheckBox  0, 181, 40, 10, "LINE12", .CheckBox12
   CheckBox  0, 196, 40, 10, "LINE13", .CheckBox13
   CheckBox  0, 211, 40, 10, "LINE14", .CheckBox14
   CheckBox  0, 227, 40, 10, "LINE15", .CheckBox15
   CheckBox  0, 241, 40, 10, "LINE16", .CheckBox16
   CheckBox  0, 257, 40, 10, "LINE17", .CheckBox17
   CheckBox  0, 269, 40, 10, "LINE18", .CheckBox18
   Text  48, 6, 143, 8, "Please check the checkboxes"
   Text  48, 16, 153, 8, "to the left to report fraud and do the "
   Text  48, 27, 152, 9, "Chargeback for the selected row or rows. "
End Dialog



Dim mydialog as cbdlg
   On Error Resume Next
   Dialog mydialog
   If Err=102 then
	  MsgBox "Chargebacks canceled."
   End If
 
'DlgEnable "CheckBox1",1 
   
   ' Set the default wait timeout value
	g_HostSettleTime = 400	' milliseconds

	OldSystemTimeout& = System.TimeoutValue
	If (g_HostSettleTime > OldSystemTimeout) Then
		System.TimeoutValue = g_HostSettleTime
	End If

' Get the necessary Session Object
	Dim Sess0 As Object
	Set Sess0 = System.ActiveSession
	If (Sess0 is Nothing) Then
		Msgbox "Could not create the Session object.  Stopping macro playback."
		STOP
	End If
	If Not Sess0.Visible Then Sess0.Visible = TRUE

If DlgValue("CheckBox1")=1  then 
 
 	
' This section of code contains the recorded events
	Sess0.Screen.Sendkeys("<Home>CCM 01 4837 999<Enter>")	
	Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
	Sess0.Screen.Sendkeys("<Tab><Tab><Tab><Tab>DS<Tab><Tab><Tab>02<Tab><Tab><Tab><Tab><Tab>UNAUTH TRANS<Tab>02100<Enter>")	
	
	Sess0.Screen.Sendkeys("<Clear>")	
	Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
	'Sess0.Screen.Sendkeys("CDS<Enter>")	
	'Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
 
 
 
 
 
 
 'This section of code contains the recorded events
	Sess0.Screen.Sendkeys("<Home>CSD4 01<Enter>")	
	Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
	Sess0.Screen.Sendkeys("<Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab>01<Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab><Tab>1<Enter>")	
	
	Sess0.Screen.Sendkeys("<Clear>")	
	
	'Sess0.Screen.Sendkeys("cds<Enter>")	
 
 
 


	System.TimeoutValue = OldSystemTimeout
ElseIf DlgValue("CheckBox1")=0  then 
 
End If



End Sub



***edited code tags***
-jjsaw5

This post has been edited by cheetahz: 05 December 2008 - 07:57 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Basic help

#2 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: Basic help

Posted 05 December 2008 - 07:54 AM

:code:
Was This Post Helpful? 0
  • +
  • -

#3 cheetahz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-December 08

Re: Basic help

Posted 05 December 2008 - 03:10 PM

From what i am reading Extra basic suports VB code? hmmmmm
now any help?

just looking for the correct format for the if then else or an idea to better lay this out
because the code snipets can only be run one at a time, once one gets done the next starts..and so on
up to 18 checkboxes

This post has been edited by cheetahz: 06 December 2008 - 06:50 AM

Was This Post Helpful? 0
  • +
  • -

#4 cheetahz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-December 08

Re: Basic help

Posted 08 December 2008 - 06:05 AM

Anyone tell me how to setup the if then else for a mulitiple checkbox situation?

is this correct? If DlgValue("CheckBox1.value")=1 then
nothing seems to work to reconize if the checkbox is checked or not checked??
Was This Post Helpful? 0
  • +
  • -

#5 dreadfear  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 180
  • Joined: 08-December 08

Re: Basic help

Posted 08 December 2008 - 11:35 PM

	Private Sub rbtnmage_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtnmage.CheckedChanged
		If rbtnmage.Checked = True Then
			warrior = 0
			mage = 1
			ccclass = 1
		End If
	End Sub


Ive used this on a select box, different to urs this one is more like a male or female checkbox so u cant chooes both but it works.
Was This Post Helpful? 0
  • +
  • -

#6 cheetahz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-December 08

Re: Basic help

Posted 16 December 2008 - 05:44 AM

is rbtnmage the same as checkbox1?? this does not seem to be working for some reason
and what is warrior
mage, and ccclass?

and how would i get this to loop if 18 checkboxes are checked to run the 18 different peices of code in order?

This post has been edited by cheetahz: 16 December 2008 - 08:01 AM

Was This Post Helpful? 0
  • +
  • -

#7 cheetahz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 05-December 08

Re: Basic help

Posted 17 December 2008 - 02:47 PM

Can anyone just post how to do the if, then else or whatever i would need?

as stated above 18 checkboxes run a bit of code for each one checked.
please help
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1