English
Forum

Access to Textdatei

 

Peter
Gückstock
Hi,
again a Anfängerfrage: I have in my Profanprogramm a TXT-File loaded, The I before with the windows-editor (empty) stored have. In these File have I inside the Profanprogramms Strings written, The I in Profan again loading and Print visible can make. Öffne I but the TXT-File with the windows-editor, is these File empty. These File should namely later over Windowsprogramme To reading and To print his.
is the so really possible?

I use Profan 6.6

Greeting Peter
 
Peter G.
Win XP, XProfan10
02/24/07  
 




Jac
de
Lad
save You tappt im dunkeln in Profan too ex?
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
02/24/07  
 




Peter
Gückstock
mandatory the Abspeichern in the Programmcode erfolgen? I have for none commands found. I thought , that with the Save in the Profaneditor and anschließendem Schnellstart from the editor out The data in these File written go.
 
Peter G.
Win XP, XProfan10
02/24/07  
 



@Hello Peter
CompileMarkSeparation
DECLARE datei$,edit&
DECLARE nr%,max%

PROC SPEICHERN

    ASSIGN #1,datei$
    REWRITE #1
    Nr% = 0
    Max% = GetLineCount(edit&)

    WhileNot Nr% > Max%

        Print #1,GetLine$(edit&,Nr%)
        Inc Nr%

    ENDWHILE

    CLOSE #1

ENDPROC


with this small Procedur save I always any Inputs in a Text-File ex and it functions perfect
 
02/24/07  
 




Jac
de
Lad
very!
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
02/24/07  
 




Peter
Gückstock
Vielen Thanks Horst,
I have your Proc for my Listbox angepaßt (getcount and getstring$).
it functions, but in the Textdatei sustain I always only whom last set from the Listbox, in the Loop müßten still any Sätze until worth, the of getcount zurückgegeben becomes, be read.
and yet to that understanding, where white Profan now, that with File$ my TXT File meant is?

Sorry for Nerverei, but I be always first glad, if I everything understood have.
 
Peter G.
Win XP, XProfan10
02/24/07  
 




Jörg
Sellmeyer
Hi Peter,
The Variable File$ must You naturally with the names your Txt-File feed.
Let File$=C:\MeinProgramm\MeineDatei.txt

Poste still simply time your Sourcecode, then can rather see, wos hakt.

Greeting
Jörg
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
02/24/07  
 



@Peter

Jörg has right - one small example would helpful !
 
02/24/07  
 




Peter
Gückstock
here one part from the Listing

here first The Proc to that write whom Kassenbon in a TXT to that later
Kundenausdruck
CompileMarkSeparation
-------Drucken--------

proc Bon_Druck

    let datei$=C:Eigene DateienProfanProjekteKassenbuchKassenbon.txt
    Assign #2,Datei$
    rewrite #2
    Nr%=0
    Max%=GetCount(BBox&)
    print max%

    WhileNot Nr%>Max%

        Print #2,GetString$(BBox&,Nr%)
        Inc Nr%

    endwhile

    Close #2

endproc

im folgenden Teil werden aus der mit einer DBF Datei gefüllten Listbox mehrere gewünschte Zeilen in eine andere Listbox übernommen. (soll Kassenbon sein)
Jede Zeile, die in den Kassenbon übernommen wurde, soll automatisch in eine TXT geschrieben werden, um zum Abschluß alle während des Tages in den Kassenbon übernommenen Sätze zur Auswertung bzw. zur Inventur zur Verfügung zu haben. (vielleicht bekomme ich daraus eine csv Datei hin )
Zusätzlich soll aber der gesamte Inhalt der Kassenbon-Listbox ineine zweite TXT Datei geschrieben werden, um diesen Kassenbon für den Kunden ausdrucken zu können

If @GetFocus(zumBon%)

    Long Lv_Item#,8 = 0  auf erste Spalte setzen
    GetSelectedItems 0
    Hole_Zeile 0
    Let Feld$ = @$(0)   zusammengesetzter Text der Zeile
    Let Feld$ = @Trim$(@Substr$(Feld$,1,	))+   +
    @Trim$(@Substr$(Feld$,2,	))+   +
    @Trim$(@Substr$(Feld$,3,	))+   +
    Zl$ = Zeile-+@Format$(00,(Zl&+1))  übersetze auch noch die Zeilennummer
    LONG Tb#,0 =-5
    LONG Tb#,4 =-60
    Long Tb#,8 =5
    Posten$=str$(Posten!)
    @SendMessage(BBox&,$0192,2,Tb#)  Parameter 3 gibt die Anzahl der Tabstopps an !!!
    Epreis$=@Substr$(Feld$,3,)
    Artikel$=@Substr$(Feld$,2,)
    Posten$=@substr$(Feld$,4,)
    Menge%=0
    Menge%=@Input$(Anzahl:,ausgewählter Artikel,Menge%)
    Epreis!=@val(EPreis$)
    Posten!=Menge%*EPreis!
    Decimals 2
    Summe!=Summe!+Posten!
    Decimals 2
    Bon$=str$(Menge%),+chr$($9)+Artikel$+chr$($9)+EPreis$++chr$($9)+str$(Posten!)+€
    @len(Artikel$)=20
    Addstring(Bbox&,str$(Menge%)+chr$($9)+Artikel$+chr$($9)+EPreis$++chr$($9)+str$(Posten!)+)
    Addstring(UBox&,str$(Summe!))

EndIf

----Fallunterscheidung durch Bediener------

if getfocus(Kassieren%)

    Rückgeld
    summe

endif

if getfocus(nächsterKd%)

    ergebn%=Messagebox(Kassierung schon durchgeführt?,ACHTUNG,308)

    if @equ(ergebn%,6)

        nächster_Kunde
        else getfocus(dlg%)

    endif

endif

if getfocus(Eintrag%)

    declare Line$,Line%,Teil$,DelPreis!,Storno$
    Line%=GetCurSel(BBox&)
    Line$=@GetString$(BBox&,Line%)
    Teil$=SubStr$(Line$,4,	)
    DelPreis!=val(Teil$)
    decimals ss=s2>2
    amount!=amount!-DelPreis!
 
Peter G.
Win XP, XProfan10
02/24/07  
 




Peter
Gückstock
Related to the write the Listboxinhalts into TXT have I hinbekommen.
remaining only yet the The question, how can I data append, without The TXT before To delete? Append not working.
 
Peter G.
Win XP, XProfan10
02/24/07  
 



You must whom Text before read and to the new amendment again reading and Save. - here's one small editor-Program - the can You for your tack certainly paraphrase - plenty success
CompileMarkSeparation
DECLARE pfad$,datei$,text$
pfad$=GETDIR$(@)
print pfad$
datei$=pfad$+\beispiel.txt Hier Dateinamen angeben
DECLARE edit&
DECLARE nr%,max%,ende%,EE%,save%
DECLARE datei_groesse%
DECLARE bereich#
EE%=0
----------------------------------------------------

PROC SPEICHERN

    ASSIGN #1,datei$
    REWRITE #1
    Nr% = 0
    Max% = GetLineCount(edit&)

    WhileNot Nr% > Max%

        Print #1,GetLine$(edit&,Nr%)
        Inc Nr%

    ENDWHILE

    CLOSE #1

ENDPROC

---------------------------------------------------

PROC EDITOR

    edit&=CREATE(MULTIEDIT,%HWND,text$,10,50,615,-370)
    datei_groesse%=FILESIZE(datei$) Grösse der Datei
    DIM Bereich#,datei_groesse%+5 Dimensionieren + 5 Byte
    READTEXT Bereich#,datei$
    SENDMESSAGE(edit&,$000C,0,Bereich#)
    SENDMESSAGE(edit&,$00B1,datei_groesse%,-1)
    SENDMESSAGE(notiz_edit&,$00C5,2500,0) Der dritte Parameter gibt die Zeichenanzahl an
    DISPOSE bereich#

ENDPROC

################## Programm-Anfang

IFNOT FILEEXISTS(datei$) wenn keine Datei da ist, wird eine erstellt

    ASSIGN #1,datei$
    REWRITE #1
    CLOSE #1

ENDIF

-----------------------------------------------------
CLS
ende%=CREATE(BUTTON,%HWND,Beenden,10,5,100,35)
save%=CREATE(BUTTON,%HWND,Speichern,200,5,100,35)
EDITOR
SetFocus(edit&)

WHILENOT EE%

    WAITINPUT
    Case GETFOCUS(ende%):END
    Case GETFOCUS(save%):SPEICHERN

ENDWHILE
lass=s4 href='./../../Function-References/XProfan/end/'>END
 
02/24/07  
 




Jörg
Sellmeyer
Hello Peter,
Why ought to Append nichtfunktionieren? you mußt your Text supra properly annpassen. means:
CompileMarkSeparation
[offtopic]Hello Horst,
again back from the Reparatur or have Dus moved?[/offtopic]
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
02/24/07  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.187 Views

Untitledvor 0 min.
RudiB.03/08/21
Georg Teles03/19/16
Ernstmeinhard01/28/16
Andreas Koch05/23/13
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie