Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Autres questions


Index du Forum » Autres questions » Sauvegarder des String dans un fichier en C.Basic
Farhi Hors ligne Membre Points: 1305 Défis: 0 Message

Sauvegarder des String dans un fichier en C.Basic

Posté le 22/01/2020 21:53

J'ai un problème, je souhaite sauvegarder un grand nombre de texte dans un fichier mais j'ai l'impression que la calculatrice est limitée à 256 octets quand on utilise la fonction save (je veux juste ajouter du texte à la suite d'un texte existant).
?->Str 1
Load("FILE.txt")->Str 2
Save "FILE.txt",Str 2 +Str 1



Dark storm Hors ligne Labélisateur Points: 11634 Défis: 176 Message

Citer : Posté le 22/01/2020 22:51 | #


Les strings sont physiquement limitées à 256 octets. À moins que C.Basic remonte cette limitation, tu ne pourra pas en mettre plus dedans.
Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Sentaro21 Hors ligne Membre Points: 877 Défis: 0 Message

Citer : Posté le 23/01/2020 03:14 | #


In C.Basic, the string variables can be extended with the following syntax.
'#Str <r>,n,m
<r>:([ALPHA]+[x^2]) default matrix of string variable.
n:maximam number of string variables.
m:maximam number of string characters.

'#Str <r>,5,10000
Up to 10000 characters and 5 string variables can be used.

Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Lephenixnoir Hors ligne Administrateur Points: 24226 Défis: 170 Message

Citer : Posté le 23/01/2020 08:40 | #


I think C.Basic does a great job of extending Casio Basic limitations, but sometimes I feel the change is half-hearted. Why not go all the way and:

• Make the Str array a map where any identifier can be used (eg. Str 10000)?
• Make String sizes dynamic up to the available size of the heap/RAM?

It kinda surprises me because your approach needs syntax extensions and manual directives. The semantics of Casio Basic already depend too much on the syntax (eg. you cannot say "Str A" with "A=1" and get "Str 1"). Why did you choose this direction? :o
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)
Sentaro21 Hors ligne Membre Points: 877 Défis: 0 Message

Citer : Posté le 23/01/2020 12:13 | #


Thanks for the positive suggestions.
I must admit that there is some problem that needs to be solved about the implementation of strings.
At first, for compatibility with Basic Casio, I thought it was enough to handle only 255 characters.
For compatibility with Basic Casio, processing of multi-byte character is necessary,
but since it is a fairly heavy processing, the longer the strings, the greater the decrease in speed.
And the strings function processing has 10 levels of stack.
For that purpose, fixed-size arrays determined from the beginning were used for the strings.

I think it is possible to adjust them and assign them dynamically.
However, this is accompanied by considerable implementation changes, which is why the specifications can not change for now.
Dynamic string processing is expensive,
I'm thinking of incorporating C functions for processing large strings.

By the way, "Str. A" syntax is possible in C.Basic.

Je continue à développer C.Basic. (Il est compatible avec Basic Casio.)
Overclocking utilitaire Ftune/Ptune2/Ptune3 est également disponible.
Si vous avez des questions ou un rapport de bogue, n'hésitez pas à me le faire savoir.
Lephenixnoir Hors ligne Administrateur Points: 24226 Défis: 170 Message

Citer : Posté le 23/01/2020 14:45 | #


Sentaro21 a écrit :
By the way, "Str. A" syntax is possible in C.Basic.

And you know, this is the absolute superiority of C.Basic on Casio Basic. It is a fast-evolving language not limited by the meaningless syntax and semantics of the old Basic.

I tend to think that most people use C.Basic by intuition and do not necessarily look at all the details of the language (which I did once in detail when I translated the manual). The extensions are somehow well-hidden. I would suggest to exploit "invisible" extensions such as the number and size of lists, strings, and the places where you are allowed to use an expression to substitute a constant value, which are intuitive, without restraint.

Anyway, thanks for considering my remarks.
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 84 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd