Jamester
03-04-2010, 11:52
Allora il seguente codice funziona pero' io vorrei mettere l'ultima parte (che ho evidenziato in rosso) in un altra procedura richiamata all'interno della stessa form (quindi mi andrebbe anche bene una private sub) dato che la parte rossa deve essere eseguita identica da altri processi. Ho cercato di metterla in un altra procedura sia private su public nello stesso forum oppure in un file .BAS ma mi da bad file name:
Public Sub ScriviFile(strfile As String)
' *** DIAGNOSTICA 2***
'MsgBox ("Sequenza scrittura file del clicksaver in corso...")
' *** DIAGNOSTICA 2 FINE***
Dim a As String
a = "AODIR::" & San_Opzioni.Combo1.Text & ""
Dim lFile As Long
lFile = FreeFile
'San2.Combo1.BackColor = &H8000000F
'Apertura File
Open strfile For Output As #lFile
'Open strfile For Append Shared As #lFile
MsgBox ("Apertura File Clicksaver")
Print #lFile, "::Config::"
Print #lFile, a
Print #lFile, "WINDOWX::346"
Print #lFile, "WINDOWY::209"
Print #lFile, "WINDOWWIDTH::351"
Print #lFile, "STARTMINIMIZED::0"
Print #lFile, "WATCHMSGBOX::1"
Print #lFile, "BUYINGAGENTSHOWHELP::0"
Print #lFile, "SOUNDS::1"
Print #lFile, "EXPAND::0"
Print #lFile, "MOUSEMOVE::1"
Print #lFile, "LOG::0"
Print #lFile, "ALERTITEM::1"
Print #lFile, "ALERTLOC::0"
Print #lFile, "ALERTTYPE::0"
Print #lFile, "BUYINGAGENTMAXTRIES::200"
Print #lFile, "BUYINGAGENTHIDE::0"
Print #lFile, "MISHTYPES::31"
Print #lFile, "HIGHLIGHTOPTS::7"
Print #lFile, "SLIDER_EASY_HARD::50"
Print #lFile, "SLIDER_GOOD_BAD::50"
Print #lFile, "SLIDER_ORDER_CHAOS::50"
Print #lFile, "SLIDER_OPEN_HIDDEN::50"
Print #lFile, "SLIDER_PHYS_MYST::50"
Print #lFile, "SLIDER_HEADON_STEALTH::50"
Print #lFile, "SLIDER_MONEY_XP::50"
Print #lFile, "BUYMOD::5"
Print #lFile, "ITEMVALUE::0::0::0::0"
Print #lFile, "BATRACKAOFOCUS::0"
Print #lFile, "ROLLRETRY::0"
Print #lFile, "IGNOREMR::0"
Print #lFile, "ALLSAMELOC::0"
Print #lFile, "USERLEVEL::1"
Print #lFile, "BUYLIST::0"
Print #lFile, "::ItemWatch::"
Close #lFile
If Clicksaver_Global.Nanot1.Value = 1 Then
Absorption_Nt
Open strfile For Append Shared As #lFile
If San2.Check1 = 1 Then
Else
If San2.Text1(0).Text = "-" Then
Else
Print #lFile, San2.Text1(0).Text
End If
End If
If San2.Check2 = 1 Then
Else
If San2.Text2(0).Text = "-" Then
Else
Print #lFile, San2.Text2(0).Text
End If
End If
If San2.Check3 = 1 Then
Else
If San2.Text3(0).Text = "-" Then
Else
Print #lFile, San2.Text3(0).Text
End If
End If
If San2.Check4 = 1 Then
Else
If San2.Text4(0).Text = "-" Then
Else
Print #lFile, San2.Text4(0).Text
End If
End If
If San2.Check5 = 1 Then
Else
If San2.Text5(0).Text = "-" Then
Else
Print #lFile, San2.Text5(0).Text
End If
End If
If San2.Check6 = 1 Then
Else
If San2.Text6(0).Text = "-" Then
Else
Print #lFile, San2.Text6(0).Text
End If
End If
If San2.Check7 = 1 Then
Else
If San2.Text7(0).Text = "-" Then
Else
Print #lFile, San2.Text7(0).Text
End If
End If
If San2.Check8 = 1 Then
Else
If San2.Text8(0).Text = "-" Then
Else
Print #lFile, San2.Text8(0).Text
End If
End If
If San2.Check9 = 1 Then
Else
If San2.Text9(0).Text = "-" Then
Else
Print #lFile, San2.Text9(0).Text
End If
End If
If San2.Check10 = 1 Then
Else
If San2.Text10(0).Text = "-" Then
Else
Print #lFile, San2.Text10(0).Text
End If
End If
If San2.Check11 = 1 Then
Else
If San2.Text11(0).Text = "-" Then
Else
Print #lFile, San2.Text11(0).Text
End If
End If
If San2.Check12 = 1 Then
Else
If San2.Text12(0).Text = "-" Then
Else
Print #lFile, San2.Text12(0).Text
End If
End If
If San2.Check13 = 1 Then
Else
If San2.Text13(0).Text = "-" Then
Else
Print #lFile, San2.Text13(0).Text
End If
End If
Print #lFile, "::LocWatch::"
Print #lFile, "::End::"
Close #lFile
Call MsgBox("Configurazione del CLICKSAVER salvata ", vbOKOnly + vbInformation + vbApplicationModal + vbDefaultButton1, "Baldios's NanoToon Reminder 5.0")
End If
End Sub
Public Sub ScriviFile(strfile As String)
' *** DIAGNOSTICA 2***
'MsgBox ("Sequenza scrittura file del clicksaver in corso...")
' *** DIAGNOSTICA 2 FINE***
Dim a As String
a = "AODIR::" & San_Opzioni.Combo1.Text & ""
Dim lFile As Long
lFile = FreeFile
'San2.Combo1.BackColor = &H8000000F
'Apertura File
Open strfile For Output As #lFile
'Open strfile For Append Shared As #lFile
MsgBox ("Apertura File Clicksaver")
Print #lFile, "::Config::"
Print #lFile, a
Print #lFile, "WINDOWX::346"
Print #lFile, "WINDOWY::209"
Print #lFile, "WINDOWWIDTH::351"
Print #lFile, "STARTMINIMIZED::0"
Print #lFile, "WATCHMSGBOX::1"
Print #lFile, "BUYINGAGENTSHOWHELP::0"
Print #lFile, "SOUNDS::1"
Print #lFile, "EXPAND::0"
Print #lFile, "MOUSEMOVE::1"
Print #lFile, "LOG::0"
Print #lFile, "ALERTITEM::1"
Print #lFile, "ALERTLOC::0"
Print #lFile, "ALERTTYPE::0"
Print #lFile, "BUYINGAGENTMAXTRIES::200"
Print #lFile, "BUYINGAGENTHIDE::0"
Print #lFile, "MISHTYPES::31"
Print #lFile, "HIGHLIGHTOPTS::7"
Print #lFile, "SLIDER_EASY_HARD::50"
Print #lFile, "SLIDER_GOOD_BAD::50"
Print #lFile, "SLIDER_ORDER_CHAOS::50"
Print #lFile, "SLIDER_OPEN_HIDDEN::50"
Print #lFile, "SLIDER_PHYS_MYST::50"
Print #lFile, "SLIDER_HEADON_STEALTH::50"
Print #lFile, "SLIDER_MONEY_XP::50"
Print #lFile, "BUYMOD::5"
Print #lFile, "ITEMVALUE::0::0::0::0"
Print #lFile, "BATRACKAOFOCUS::0"
Print #lFile, "ROLLRETRY::0"
Print #lFile, "IGNOREMR::0"
Print #lFile, "ALLSAMELOC::0"
Print #lFile, "USERLEVEL::1"
Print #lFile, "BUYLIST::0"
Print #lFile, "::ItemWatch::"
Close #lFile
If Clicksaver_Global.Nanot1.Value = 1 Then
Absorption_Nt
Open strfile For Append Shared As #lFile
If San2.Check1 = 1 Then
Else
If San2.Text1(0).Text = "-" Then
Else
Print #lFile, San2.Text1(0).Text
End If
End If
If San2.Check2 = 1 Then
Else
If San2.Text2(0).Text = "-" Then
Else
Print #lFile, San2.Text2(0).Text
End If
End If
If San2.Check3 = 1 Then
Else
If San2.Text3(0).Text = "-" Then
Else
Print #lFile, San2.Text3(0).Text
End If
End If
If San2.Check4 = 1 Then
Else
If San2.Text4(0).Text = "-" Then
Else
Print #lFile, San2.Text4(0).Text
End If
End If
If San2.Check5 = 1 Then
Else
If San2.Text5(0).Text = "-" Then
Else
Print #lFile, San2.Text5(0).Text
End If
End If
If San2.Check6 = 1 Then
Else
If San2.Text6(0).Text = "-" Then
Else
Print #lFile, San2.Text6(0).Text
End If
End If
If San2.Check7 = 1 Then
Else
If San2.Text7(0).Text = "-" Then
Else
Print #lFile, San2.Text7(0).Text
End If
End If
If San2.Check8 = 1 Then
Else
If San2.Text8(0).Text = "-" Then
Else
Print #lFile, San2.Text8(0).Text
End If
End If
If San2.Check9 = 1 Then
Else
If San2.Text9(0).Text = "-" Then
Else
Print #lFile, San2.Text9(0).Text
End If
End If
If San2.Check10 = 1 Then
Else
If San2.Text10(0).Text = "-" Then
Else
Print #lFile, San2.Text10(0).Text
End If
End If
If San2.Check11 = 1 Then
Else
If San2.Text11(0).Text = "-" Then
Else
Print #lFile, San2.Text11(0).Text
End If
End If
If San2.Check12 = 1 Then
Else
If San2.Text12(0).Text = "-" Then
Else
Print #lFile, San2.Text12(0).Text
End If
End If
If San2.Check13 = 1 Then
Else
If San2.Text13(0).Text = "-" Then
Else
Print #lFile, San2.Text13(0).Text
End If
End If
Print #lFile, "::LocWatch::"
Print #lFile, "::End::"
Close #lFile
Call MsgBox("Configurazione del CLICKSAVER salvata ", vbOKOnly + vbInformation + vbApplicationModal + vbDefaultButton1, "Baldios's NanoToon Reminder 5.0")
End If
End Sub