Paskal problem!

3

Paskal problem!

offline
  • Pridružio: 10 Mar 2005
  • Poruke: 222

Kaca ::@Licanin
Koji je Pascal ili Delphi? Ako je Turbo Pascal, ne moze se upotrebiti 'length'.


Svaki TP koristi Length naredbu, to mu je core funkcija. Čak i TP 5.5 (koji se moze skinuti sa dz sa Interneta).

Dopuna: 08 Mar 2006 16:45

marko89bab ::U pitanju je prosek ocena. U skoli smo radili ovaj zadatak i kod svih radi samo kod mene ne. Ne znam u cemu je problem. Ako moze mala pomoc.


Case..of radi samo sa integer promenjivima.

Umesto Case...of moze da se koristi i

if a in ['a','e','i','o','u'] then...



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
offline
  • Srđan Tot
  • Am I evil? I am man, yes I am.
  • Pridružio: 12 Jul 2005
  • Poruke: 2483
  • Gde živiš: Ljubljana

case radi sa svim ordinal tipovima podataka.

Evo sta Delphi help kaze o njima:
Citat:Ordinal types include integer, character, Boolean, enumerated, and subrange types. An ordinal type defines an ordered set of values in which each value except the first has a unique predecessor and each value except the last has a unique successor. Further, each value has an ordinality which determines the ordering of the type. In most cases, if a value has ordinality n, its predecessor has ordinality n - 1 and its successor has ordinality n + 1.

For integer types, the ordinality of a value is the value itself.
Subrange types maintain the ordinalities of their base types.
For other ordinal types, by default the first value has ordinality 0, the next value has ordinality 1, and so forth. The declaration of an enumerated type can explicitly override this default.

Several predefined functions operate on ordinal values and type identifiers. The most important of them are summarized below.

Function Parameter Return value Remarks
Ord ordinal expression ordinality of expression's value Does not take Int64 arguments.
Pred ordinal expression predecessor of expression's value
Succ ordinal expression successor of expression's value
High ordinal type identifier or variable of ordinal type highest value in type Also operates on short-string types and arrays.
Low ordinal type identifier or variable of ordinal type lowest value in type Also operates on short-string types and arrays.
For example, High(Byte) returns 255 because the highest value of type Byte is 255, and Succ(2) returns 3 because 3 is the successor of 2.
The standard procedures Inc and Dec increment and decrement the value of an ordinal variable. For example, Inc(I) is equivalent to I := Succ(I) and, if I is an integer variable, to I := I + 1.



offline
  • Pridružio: 10 Mar 2005
  • Poruke: 222

Srki_82 ::case radi sa svim ordinal tipovima podataka.


U pravu si, nego sam hteo da kazem da ne moze da stavi da je "a" real i da ocekuje da to radi...

Ko je trenutno na forumu
 

Ukupno su 926 korisnika na forumu :: 45 registrovanih, 5 sakrivenih i 876 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: 357magnum, 8u47, Asparagus, babaroga, bokisha253, Boris Bosiljčić, BORUTUS, Brana01, comi_pfc, cvrle312, darcaud, DENIRO, Dimitrise93, DPera, dragoljub11987, dragon986, dule10savic, FileFinder, Georgius, goxin, h8propaganda, hooraay, ikan, JOntra, Kubovac, Lieutenant, mercedesamg, mile23, milenko crazy north, Miroljub1979, novator, opt1, pein, pera bager, repac, Ripanjac, stegonosa, suponik, vathra, Vladko, vladulns, Volkhov-M, VP6919, wolverined4, 125