Ga naar inhoud

Klein dom visual basic vraagje


anoniem

Aanbevolen berichten

print = qbasic, niet vb lprint = naar printer (d8 ik) de functie die je zoeket heet string$, de beschrijving hieronder komt uit de qbasic 7.1 help [code:1:2c3303512e]STRING$(m%,n%) or STRING$(m%,stringexpression$) * m% A numeric expression indicating the length of the string to return. * n% An integer expression with a value between 0 and 255 that is the ASCII character code of the character that fills the string. * stringexpression$ A string whose first character fills the string. Returns A string whose characters all have a given ASCII code or whose characters are all the first character of a string expression.[/code:1:2c3303512e] [code:1:2c3303512e]'This example uses the STRING$ function to generate a bar graph. CLS PRINT TAB(7);"Daily Mean Temperature in Seattle" PRINT 'Get data for each month and graph. FOR Month = 1 TO 12 STEP 2 READ Month$, Temp 'Print Temp-35 stars. PRINT Month$;" +"; STRING$(Temp-35,"*") PRINT " |" NEXT Month 'Print horizontal line. PRINT " +"; FOR X = 1 TO 7 PRINT "----+"; NEXT X PRINT 'Print temperature labels. FOR X = 4 TO 39 STEP 5 PRINT TAB(X); X+31; NEXT X PRINT DATA Jan, 40, Mar, 46, May, 56 DATA Jul, 66, Sep, 61, Nov, 46 'Sample Output ' 'Daily Mean Temperature in Seattle ' 'Jan +***** ' | 'Mar +*********** ' | 'May +********************* ' | 'Jul +******************************* ' | 'Sep +************************** ' | 'Nov +*********** ' | ' +----+----+----+----+----+----+----+ ' 35 40 45 50 55 60 65 70 [/code:1:2c3303512e] Snappie? :wink:
Link naar reactie
Oeps, ja foutje. Overigens is het niet gebruikelijk dat je in Visual Basic het type dat geretourneerd wordt door een functie achter de functienaam zet (voor de typen die met een teken gerepresenteerd kunnen worden, zoals String ($), Integer (%) en Long (&)). De definitie van de functie bepaalt al wat voor type er wordt geretourneerd.
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

×
×
  • Nieuwe aanmaken...