loading...
آموزش برنامه نویسی
علینقی ها بازدید : 141 چهارشنبه 30 بهمن 1392 نظرات (0)

برای نوشتن برنامه ابتدا باید مراحل تحلیل مساله و الگوریتم را  گذرانده باشید

اگر دقت کنید مهمترین دستوراتی که تقریبا در همه الگوریتم ها وجود دارند دریافت از ورودی و چاپ نتایج می باشد آنچه مسلم است برنامه ای که نتیجه نداشته باشد اصلا نیاز به نوشتن نخواهد داشت

دستور ورودی :

مثلا :

    عدد  a  را دریافت کن  معادل

a=val(inputbox(""))

عدد m  را دریافت کن

m=val(inputbox("   یک عدد وارد کن "))

 در این  دو دستور وظیفه VAL تبدیل وردی از حالت نوشته به عدد است که بهتر است بنویسیم در غیر اینصورت دستور

a=inputbox("")

نیز کار ورود داده را انجام می دهد

ساختار این دستور در حالت کلی بصورت زیر است

 

stringvariable = InputBox(prompt[, title] [, default] [, xpos] [,ypos] [, helpfilecontext])

 


Argument

Description

prompt

Required. String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used.

title

Optional. String expression displayed in the title bar of the dialog box. If you omittitle, the application name is placed in the title bar.

default

Optional. String expression displayed in the text box as the default response if no other input is provided. If you omit default, the text box is displayed empty.

xpos andypos

Both optional. Numeric expressions that specify custom positioning of the box on screen (by default, the box is displayed in the center of the screen, which is usually desired).

helpfile andcontext

Both optional. Can be used if a help file has been set up for the application. If either one of these arguments are used, they both must be used.

 

البته نیازی نیست حتما دستور کلی را یاد بگیریم برای برنامه نویسی در سطح کلاس و مسابقه سطح شهرستان دانشتن دو دستور ساده بیان شده کافی است. توجه داشته باشید که روشها و دستورات دیگری نیز برای ورود داده ها وجود دارد

 

 

خروجی: دستور خروجی در الگوریتم بصورت زیر می آید

عدد m  را چاپ کن

msgbox(m);

چاپ کن " زوج"

msgbox("زوج")

دقت کنید برای چاپ یک جمله یا کلمه استفاده از دو علامت کیومه (") مانند مثال لازم است 

MsgBox(prompt[, buttons] [, title] [, helpfilecontext])

The MsgBox function syntax has these parts:

 

Part

Description

prompt

Required. String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used.

buttons

Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. If omitted, the default value for buttons is 0 (which causes only an OK button to be displayed with no icon). The buttons argument is explained in more detail below.

title

Optional. String expression displayed in the title bar of the dialog box. If you omittitle, the application name is placed in the title bar.

helpfile andcontext

Both optional. These arguments are only applicable when a Help file has been set up to work with the application.

 

دوباره تاکید می کنم که برای شما یاد گرفتن دستور کلی و جدول الزامی نیست.

بالاخره ما هم مطالعه آزاد داریم دیگه!

ارسال نظر برای این مطلب

کد امنیتی رفرش
اطلاعات کاربری
  • فراموشی رمز عبور؟
  • آرشیو
    آمار سایت
  • کل مطالب : 25
  • کل نظرات : 13
  • افراد آنلاین : 1
  • تعداد اعضا : 12
  • آی پی امروز : 10
  • آی پی دیروز : 15
  • بازدید امروز : 17
  • باردید دیروز : 19
  • گوگل امروز : 0
  • گوگل دیروز : 1
  • بازدید هفته : 109
  • بازدید ماه : 444
  • بازدید سال : 2,868
  • بازدید کلی : 26,314