aufbau eines schreib programmes
Übersicht

![]() |
mas93Betreff: aufbau eines schreib programmes |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hi leute,Ich will mal nafangen n kleines schreibprogramm zu proggen.
Wie geh ich das ma besten an? Habt ihr da n paar ideen?? mfg marius |
||
![]() |
Pdd |
![]() Antworten mit Zitat ![]() |
---|---|---|
Meinst du dabei sowas wie Word?
Interesante Idee, ich denke du brauchst zuerst eine geeignete Input Rutine. Dann Farben, Formatierungen, etc. Vllt mit Types. ![]() |
||
Lieber Apfel als Birne. |
![]() |
mas93 |
![]() Antworten mit Zitat ![]() |
---|---|---|
ja,sowas wie word.
Nur hab ich kein Plan wie ich ne input routine sychreiben soll.hab sowas noch nie gemacht. |
||
![]() |
BlitzcoderNewsposter |
![]() Antworten mit Zitat ![]() |
---|---|---|
Du kannst mit den Befehlen getkey und keydown tasten abfragen. Gerade getkey ist für inpuroutinen für Anfänger praktisch. Mit den Befehlen asc() und chr() kannst du die getkey Codes in zeichen, bzw. zurück umrechnen. Schau dir diese Befehle mal an(blitzbase.de). Wenn du schauen willst, wie soetwas aussieht, such hier im Codearchiv danach, dort sind zig Inputroutinen.
MfG |
||
P4 3 Ghz@3,55Ghz|GF 6600GT 256MB|Samsung 80GB | 2x Samsung 160GB|2048MB DDR-400 RAM|6 Mbit Flatrate | Logitech G15 | Samsung 225BW-TFT | Ubuntu Gutsy Linux | Windows Vista | Desktop | Blog | CollIDE | Worklog
________________ |°°°°°°°°°°°°°°||'""|""\__,_ |______________ ||__ |__|__ |) |(@) |(@)"""**|(@)(@)****|(@) |
![]() |
mas93 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Code: [AUSKLAPPEN] AppTitle "EXTREME WRITER" Graphics 640,480,16,0 ;SACHEN LADEN ;------------------HAUPTSCHLEIFE----------------------------- satz=Input("GIB WAS EIN: ") Repeat If KeyHit(57) Then speichern() If KeyHit(2) Then oeffnen() Flip Until KeyHit(1) End Function speichern() datei = WriteFile("dokument.mas") WriteLine datei,satz CloseFile datei WaitKey End Function Function oeffnen() Cls datei= ReadFile("dokument.mas") Print ReadLine(datei) CloseFile datei WaitKey End Function wenn ich das öffne steht im dokument nur ne 0??? |
||
![]() |
Hagbard |
![]() Antworten mit Zitat ![]() |
---|---|---|
Einfache Fehleranalyse:
Es wird kein Text im Dokument gespeichert, also könnt es sein, dass die Variable falsch verwendet wird o.ä und tatsächlich hast du vergessen die Variable global zu setzen, da du sie ja in einer Funktion verwendest. Dazu kommt, dass Input einen String zurückgibt und die Variable, die das speichert auch so behandelt werden muss, d.h. Global satz$ = ... |
||
![]() |
darth |
![]() Antworten mit Zitat ![]() |
---|---|---|
. . .
ein "word" mit input ist seeeeehr optimistisch, ich empfehle (wie einer der vorschreiber) eine routine mit getkey() btw: ich hab sowas auch probiert (niedriges niveau, editor ähnlich => kein autom. zeilenumbruch, keine formatierungen) - und ich muss sagen, dass ich es aufgegeben habe, es ist nicht einfach :S |
||
Diese Signatur ist leer. |
![]() |
Hellfront |
![]() Antworten mit Zitat ![]() |
---|---|---|
![]() ![]() satz$ = Input$("...") so müsste die Input Zeile sein. PS: Ich hoffe du wolltest jetzt nur die speicherroutine ausprobieren und nicht den ganzen Editor mit INput schreiben ![]() |
||
![]() |
mas93 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Danke für die antworten.
Und LÖÖÖÖÖÖÖÖl natürlich will ich nicht den ganzen editor mit inputschreiben.Ich wollte nur das mit dem speichern und laden mal probieren. |
||
![]() |
mas93 |
![]() Antworten mit Zitat ![]() |
---|---|---|
So,Ich hab noch ne frage.
Wie soll ich die input routine schreiben??Gibts da n tutorial??? |
||
![]() |
D2006Administrator |
![]() Antworten mit Zitat ![]() |
---|---|---|
~GESCHLOSSEN~ Du hast schon eine Verwarnung wegen Doppelpostings gekriegt. HÖR ENDLICH AUF DAMIT... EDIT: ~WIEDERERÖFFNET~ Ups, das war ja ne andere 93. Sorry, verwechselt. Trotzdem ermahne ich dich, in Zukunft Doppelposts zu vermeiden und den Editiert Button (der tolle Schraubenschlüssel rechts über dem Beitrag) zu benutzen. |
||
Intel Core i5 2500 | 16 GB DDR3 RAM dualchannel | ATI Radeon HD6870 (1024 MB RAM) | Windows 7 Home Premium
Intel Core 2 Duo 2.4 GHz | 2 GB DDR3 RAM dualchannel | Nvidia GeForce 9400M (256 MB shared RAM) | Mac OS X Snow Leopard Intel Pentium Dual-Core 2.4 GHz | 3 GB DDR2 RAM dualchannel | ATI Radeon HD3850 (1024 MB RAM) | Windows 7 Home Premium Chaos Interactive :: GoBang :: BB-Poker :: ChaosBreaker :: Hexagon :: ChaosRacer 2 |
![]() |
darth |
![]() Antworten mit Zitat ![]() |
---|---|---|
jap gibts | ||
Diese Signatur ist leer. |
![]() |
mas93 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Code: [AUSKLAPPEN] AppTitle "EXTREME WRITER" Graphics 640,480,16,0 ;SACHEN LADEN Global antwort$,backtime = MilliSecs(),ccolor ;------------------HAUPTSCHLEIFE----------------------------- Repeat befehl$ = newinput$(x,y,x,y,"", 200) If KeyHit(57) Then speichern() If KeyHit(2) Then oeffnen() If KeyHit(3) Then farbe() Flip Cls Until KeyHit(1) End Function speichern() datei = WriteFile("dokument.mas") WriteLine datei,antwort$ CloseFile datei WaitKey End Function Function oeffnen() Cls datei= ReadFile("dokument.mas") Print ReadLine(datei) CloseFile datei WaitKey End Function Function newinput$(x1,y1,x2,y2,frage$,maxl) a = GetKey() If a => 32 And a <= 255 And Len(antwort$) <= maxl-1 Then antwort$ = antwort$ + Chr$(a) If KeyDown(28) Then Return antwort$ If KeyDown(14) Or KeyDown(203) And Len(antwort$) > 0 And MilliSecs()-backtime > 125 Then antwort$ = Left(antwort$,(Len(antwort$)-1)) backtime = MilliSecs() End If Color 25,100,200 Rect x1, y1,x2-x1, y2-y1,1 Color 10,50,150 Rect x1, y1,x2-x1, y2-y1,0 textlange = StringWidth(antwort$) ;Blinkener Cursor texthohe = StringHeight(antwort$) fragelange = StringWidth(frage$) Color 0,50,ccolor Rect x1+28+(Len(antwort$)*8),y1+4,10,texthohe-1,1 ccolor = ccolor + 5 If ccolor = 255 Then ccolor = 100 Color RequestedRed,RequestedGreen,RequestedBlue Text x1+3,y1+3, frage$ + " " + antwort$ End Function Function farbe() RequestColor(255,0,0) End Function es wird irgendwie kein text angezeigt seit ich das mit der farbe drinn hab. Bevor und danach ich die farbe ausgewählt hab Habtr ihr ne idee? mfg marius |
||
![]() |
BladeRunnerModerator |
![]() Antworten mit Zitat ![]() |
---|---|---|
du hast nach requestesred() etc. die Klammern vergessen, daher wird immer schwarz gesetzt.
Alle Funktionen die etwas zurückgeben müssen mit () am ende aufgerufen werden um zu funktionieren. |
||
Zu Diensten, Bürger.
Intel T2300, 2.5GB DDR 533, Mobility Radeon X1600 Win XP Home SP3 Intel T8400, 4GB DDR3, Nvidia GF9700M GTS Win 7/64 B3D BMax MaxGUI Stolzer Gewinner des BAC#48, #52 & #92 |
![]() |
Hagbard |
![]() Antworten mit Zitat ![]() |
---|---|---|
Code: [AUSKLAPPEN] AppTitle "EXTREME WRITER"
Graphics 640,480,16,2 ;SACHEN LADEN Global antwort$,backtime = MilliSecs(),ccolor ;------------------HAUPTSCHLEIFE----------------------------- Global rot = 255 Global grun = 255 Global blau = 255 Repeat befehl$ = newinput$(x,y,x,y,"", 200) If KeyHit(57) Then speichern() If KeyHit(2) Then oeffnen() If KeyHit(3) Then farbe() Color 255, 255, 255 Text 200, 200, rot + " " + grun + " " + blau Flip Cls Until KeyHit(1) End Function speichern() datei = WriteFile("dokument.mas") WriteLine datei,antwort$ CloseFile datei WaitKey End Function Function oeffnen() Cls datei= ReadFile("dokument.mas") Print ReadLine(datei) CloseFile datei WaitKey End Function Function newinput$(x1,y1,x2,y2,frage$,maxl) a = GetKey() If a => 32 And a <= 255 And Len(antwort$) <= maxl-1 Then antwort$ = antwort$ + Chr$(a) If KeyDown(28) Then Return antwort$ If KeyDown(14) Or KeyDown(203) And Len(antwort$) > 0 And MilliSecs()-backtime > 125 Then antwort$ = Left(antwort$,(Len(antwort$)-1)) backtime = MilliSecs() End If Color 25,100,200 Rect x1, y1,x2-x1, y2-y1,1 Color 10,50,150 Rect x1, y1,x2-x1, y2-y1,0 textlange = StringWidth(antwort$) ;Blinkener Cursor texthohe = 16;StringHeight(antwort$) fragelange = StringWidth(frage$) Color 0,50,ccolor Rect x1+28+(Len(antwort$)*8),y1+4,10,texthohe-1,1 ccolor = ccolor + 5 If ccolor = 255 Then ccolor = 100 Color rot, grun, blau ;Color 255, 255, 255 Text x1+3,y1+3, frage$ + " " + antwort$ End Function Function farbe() RequestColor(255,0,0) rot = RequestedRed() grun = RequestedGreen() blau = RequestedBlue() End Function edit: Erklärung siehe Bladerunner |
||
![]() |
mas93 |
![]() Antworten mit Zitat ![]() |
---|---|---|
upps ![]() hab voll vergessen dass das funktionen sind. DANKE! [edit] Code: [AUSKLAPPEN] Graphics 640,480,16,2 ;SACHEN LADEN Global antwort$,backtime = MilliSecs(),ccolor ;------------------HAUPTSCHLEIFE----------------------------- Global rot = 255 Global grun = 255 Global blau = 255 Repeat befehl$ = newinput$(x,y,x,y,"", 200) If KeyHit(57) Then speichern() If KeyHit(2) Then oeffnen() If KeyHit(3) Then farbe() Flip Cls Until KeyHit(1) End Function speichern() datei = WriteFile("dokument.mas") WriteLine datei,antwort$ CloseFile datei WaitKey End Function Function oeffnen() Cls lesen$=RequestFile("Wählen Sie eine Datei aus","mas",0) datei= ReadFile(lesen$) Print ReadLine(datei) CloseFile datei WaitKey End Function Function newinput$(x1,y1,x2,y2,frage$,maxl) a = GetKey() If a => 32 And a <= 255 And Len(antwort$) <= maxl-1 Then antwort$ = antwort$ + Chr$(a) If KeyDown(28) Then Return antwort$ If KeyDown(14) Or KeyDown(203) And Len(antwort$) > 0 And MilliSecs()-backtime > 125 Then antwort$ = Left(antwort$,(Len(antwort$)-1)) backtime = MilliSecs() End If Color 25,100,200 Rect x1, y1,x2-x1, y2-y1,1 Color 10,50,150 Rect x1, y1,x2-x1, y2-y1,0 textlange = StringWidth(antwort$) ;Blinkener Cursor texthohe = 16;StringHeight(antwort$) fragelange = StringWidth(frage$) Color 0,50,ccolor Rect x1+28+(Len(antwort$)*8),y1+4,10,texthohe-1,1 ccolor = ccolor + 5 If ccolor = 255 Then ccolor = 100 Color rot, grun, blau ;Color 255, 255, 255 Text x1+3,y1+3, frage$ + " " + antwort$ End Function Function farbe() RequestColor(255,0,0) rot = RequestedRed() grun = RequestedGreen() blau = RequestedBlue() End Function Ähm ich hab mich entschieden das schreibprog in Bloitz Plus zu machen.Leider hab ich da noch keine erfahrung. Ich will jetzt das Prog in nem fensteer starten. Also so: Code: [AUSKLAPPEN] enster=CreateWindow("Extreme writer",100,100,200,100) menu10=CreateMenu("Datei",10,WindowMenu(fenster)) menu11=CreateMenu("Laden",11,WindowMenu(menu10)) menu12=CreateMenu("Speichern",12,WindowMenu(menu10)) UpdateWindowMenu fenster aber wenn ivh das so am anfang einbau geht das nicht. Wisst ihr,wo genau der code hin muss? mfg marius |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group