thank you dsl..you were right.I shifted all of the variable definitions to the start of program blocks and that error vanished.but after building the project I faced to another error which doesn't point to my code lines..!!
___________________________________________________
ERROR(PROBLEMS TAB):
make: *** [c2h_hdl-t] Error 254
___________________________________________________
contexts of (console tab):
Info: Wrote G:/Nios/standard/NiosII_cycloneII_2c35_standard_sopc.sopcinfo
Info: NiosII_cycloneII_2c35_standard_sopc: Wrote G:/Nios/standard/NiosII_cycloneII_2c35_standard_sopc.html
Info: NiosII_cycloneII_2c35_standard_sopc: Generating QIP file.
Info: Info: *******************************************************************
Info: Info: Running Quartus II Shell
Info: Info: Version 9.1 Build 222 10/21/2009 SJ Full Version
Info: Info: Copyright (C) 1991-2009 Altera Corporation. All rights reserved.
Info: Info: Your use of Altera Corporation's design tools, logic functions
Info: Info: and other software and tools, and its AMPP partner logic
Info: Info: functions, and any output files from any of the foregoing
Info: Info: (including device programming or simulation files), and any
Info: Info: associated documentation or information are expressly subject
Info: Info: to the terms and conditions of the Altera Program License
Info: Info: Subscription Agreement, Altera MegaCore Function License
Info: Info: Agreement, or other applicable license agreement, including,
Info: Info: without limitation, that your use is for the sole purpose of
Info: Info: programming logic devices manufactured by Altera and sold by
Info: Info: Altera or its authorized distributors. Please refer to the
Info: Info: applicable agreement for further details.
Info: Info: Processing started: Tue Feb 09 01:24:06 2010
Info: Info: Command: quartus_sh -t sopc_add_qip_file.tcl
Info: Info: Evaluation of Tcl script sopc_add_qip_file.tcl was successful
Info: Info: Quartus II Shell was successful. 0 errors, 0 warnings
Info: Info: Peak virtual memory: 102 megabytes
Info: Info: Processing ended: Tue Feb 09 01:24:06 2010
Info: Info: Elapsed time: 00:00:00
Info: Info: Total CPU time (on all processors): 00:00:00
Error: Can't create file G:/Nios/standard/NiosII_cycloneII_2c35_standard_sopc.ptf
Error: System generation failed.
make: *** [c2h_hdl-t] Error 254
Build completed in 157.569 seconds