为什么我已经在控制器里面定义了$data变量,但是视图页面却总是显示未定义变量data? 5C

图片说明
这是页面出现的问题!!!

图片说明
这是控制器的代码

图片说明
视图页面方面的代码

5个回答

可以截下你的项目结构吗,现在看应该是你控制器方法渲染的页面错了

你在php查询后打印一下$data看一下是不是有结果,最简单的方法是你直接在方法第一行先定义一下$data='';

这是你前端页面,渲染没对!不是那样渲染的!


把视图里的遍历foreach换成这种写法

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
用 Data 定义变量
用 Data 定义变量Data a{ 'aaaaaa' } $a.GetType() StringData Strings { ConvertFrom-StringData @' MSG_TARGET_IMAGE = Target image: '{0}' ERR_FILE_NO_EXISTS = The file '{0}' does not exists '@ }
为什么我定义了变量编译显示未定义 求解
#includernrnclass complexrnrnpublic: //外部接口rn complex(double r=0.0,double i=0.0)rn rn real=r;rn imag=i;rn rn complex operator +(complex c2); //+重载为成员函数rn complex operator -(complex c2); // -重载为成员函数rn void display(); //输出复数rnprivate:rn double real; //复数实部rn double imag; //复数虚部rn;rncomplex complex::operator +(complex c2) //重载函数实现rnrn complex c;rn c.real=c2.real+real;rn c.imag=c2.imag+imag;rn return complex(c.real,c.imag);rnrncomplex complex::operator -(complex c2) //重载函数实现rnrncomplex c;rnc.real=c2.real-real;rnc.imag=c2.imag-imag;rncomplex(c.real,c.imag);rnrnrnvoid display()rnrncout<<"("<
为什么说我变量未定义
DECLARE @TableName NVARCHAR (100)rnSelect @TableName='dbo.TMP_Template'rnrnDECLARE HeadTemplate_Cursor cursor forrnselect LeftStr,MiddleStr,RightStr from @TableNamernrn提示错误:rn变量未定义rnrn奇怪:(rn
为什么我这样定义的变量总是不对?
package rn rn import flash.display.MovieClip;rn import flash.events.*;rn import tv.palmerama.gui.*;rn rn public class main extends MovieClip rnrnrn public var winManager:WindowManager;rn public var winNum:int;rn rn public function main() rnrnrnrn winManager:WindowManager = new WindowManager();<--rn addChildAt(winManager, 1);rnrn winNum:int = 1;<--rn newBTN.addEventListener(MouseEvent.CLICK, makeNewWindow);rnrnrnrn rnrnrn public function makeNewWindow(e:MouseEvent):voidrn rn var randomX:Number = Math.random()*stage.stageWidth-200;rn var randomY:Number = Math.random()*stage.stageHeight-80;rn var randomW:Number = 150+Math.random()*400;rn var randomH:Number = 80+Math.random()*400;rn rn winManager.newWindow(randomX, randomY, randomW, randomH, 0.2, "Inspector Window "+winNum);rn winNum++;rn rnrn rn rn rnrnrnrn一个代码片段... rnrnC:\Documents and Settings\admin\Desktop\Insp-ector\main.as,17 行 1067: tv.palmerama.gui:WindowManager 类型值的隐式强制指令的目标是非相关类型 Class。rnC:\Documents and Settings\admin\Desktop\Insp-ector\main.as,17 行 1188: 对类 WindowManager 的赋值非法。rnC:\Documents and Settings\admin\Desktop\Insp-ector\main.as,20 行 1067: int 类型值的隐式强制指令的目标是非相关类型 Class。rnC:\Documents and Settings\admin\Desktop\Insp-ector\main.as,20 行 1188: 对类 int 的赋值非法。rn
定义了的变量但是没有使用和未定义的变量的相关知识
今天在思考我定义并初始化了的变量在程序中未使用到,在编译的时候编译器是怎么对待这些值的。在寻找答案时又引发了如果我变量未初始化会怎么样?然后就写程序测试了下。 #include&amp;lt;stdio.h&amp;gt; int iGloblVal ; int main(void) { int iPartVal; printf(&quot;iGloblVal = %d\n&quot;,iGloblVal); prin...
vue中data变量定义问题
vue中报Cannot read property 'value1' of undefined 这两天在使用uni-app写一个功能时,值能够成功渲染到页面,但老是报值为undefined,最开始还以为是异步加载的问题。如下图: 找了好久的问题,怎么看都没毛病! 最后发现data()的return里的变量出了问题,我这里写的是_2hpdg,原来在这里的变量不能出现特殊字符或者数字。长知识了!...
按钮submit作为变量用到的时候,为什么总是变量未定义?
比如:rnwindow.location="45.php";;rn rn?>rn rnrn rnrn运行时,错误日志显示undefined variable:submitrn为什么?
定义了变量,却。。。。
declare @sql nvarchar(4000)rn declare @table table (newid int identity(1,1),tid int) rn set @sql = 'insert into @table(tid) select ' + @PK + ' from ' + @Tables + @strFilter + ' ' + @strGroup + ' ORDER BY ' + @Sort rn +' select ' + @Fields + ' from ' + @Tables + ' a join @table b on a.' +@PK + '=b.tid and b.newid between ' rn + convert(varchar(20),@begin_id) + ' and 'rn + convert(varchar(20),@end_id) + ' ' + @strSimpleFilter + ' ' + @strGroup + ' ORDER BY ' + @Sort rn rn exec sp_executesql @sqlrnrnrn在执行上面这句动态SQL时,报错说@table未定义,对此非常不解,特发贴问之。
VB总是弹出"变量未定义"
我在vb输入:rnPrivate Sub 打开_Click()rnCommonDialog3.FileName = ""rnCommonDialog3.Flags = 4096rnCommonDialog3.ShowOpenrnCommonDialog3.Filter = "all files|*.*|(*.TXT)|*.TXT|(*.DOC)|*.DOC"rnCommonDialog3.FilterIndex = 3rnCommonDialog3.DialogTitle = "打开"rnCommonDialog3.Action = 1rnIf CommonDialog3 = "" Thenrn MsgBox "No file selectd", 37, "Checking"rnElsern '对所选择的文件进行处理rn Open CommonDialog3.FileName For Input As #1rn Do While Not EOF(1)rn Input #1, a$rn Print a$rn LooprnEnd IfrnEnd SubrnVB总是弹出"变量未定义",Input #1, a$rn Print a$rn变成了红色.这是为什么?我可是按照书上说的来做的.
为何定义了的变量还显示未定义标识符
我在Grid.h中定义了一个类,其成员:rnclass Gridrnrnpublic:rn Grid( ID3D10Device* pD3DDevice );rn virtual ~Grid( void );rnrn int dim[3];rn int maxDim;rnrn HRESULT InitGrid(int gridWidth, int gridHeight, int gridDepth,ID3D10EffectTechnique* technique);rn ......rnrnprotected:rn int texCols;rn int texRows;rn ......rnrn但是在Grid.cpp中写InitGrid函数时dim、maxDim、texCols、texRows这些变量都说是“未定义标示符”rn函数如下:rnHRESULT InitGrid( int gridWidth, int gridHeight, int gridDepth,ID3D10EffectTechnique* technique )rnrn HRESULT hr;rnrn dim[0] = gridWidth;rn dim[1] = gridHeight;rn dim[2] = gridDepth;rnrn maxDim = max( max( dim[0], dim[1] ), dim[2] );rnrn ComputeRowColsForFlat3DTexture(dim[2], &texCols, &texRows);rn ......rnrnGrid.cpp开头已经包含了Grid.h了,而且诡异的是再其他函数里这些变量都能正常访问rn请问各位大虾这是怎么一回事rn用的VS2010rnrn
浏览器总是提示变量未定义
代码大致如下:rn rnrnrnrn....rnrn 确定rn rnrn运行的时候浏览器就提示rnbtnOK未定义,但btnOK在“
程序提示变量未定义,但是我定义了的啊
代码如下rn# include rn# include rn# include rnchar str1[]="you have input up key";rnchar str3[]="you have input control key";rnchar str4[]="you have input shift key";rnchar str5[]="you have input cotrol a key";rnchar str6[]="you have input shift b key";rnbool nUpKeyDown,nCtrlKeyDown,nShiftKeyDown,nCtrlAkeyDown,nShiftBKeyDwon;rnLRESULT CALLBACK Winsunproc(rn HWND hwnd, rn UINT uMsg, rn WPARAM wParam, rn LPARAM lParam rn);rnint WINAPI WinMain(rn HINSTANCE hInstance, rn HINSTANCE hPrevInstance, rn LPSTR lpCmdLine, rn int nCmdShow rn)rnrn HWND hwnd;rn MSG msg;rn WNDCLASS wndclass1;rn wndclass1.lpfnWndProc=Winsunproc;rn wndclass1.style=0;rn wndclass1.cbClsExtra=0;rn wndclass1.cbWndExtra=0;rn wndclass1.hInstance=hInstance;rn wndclass1.hCursor=LoadCursor(NULL,IDC_ARROW);rn wndclass1.hIcon=LoadIcon(NULL,IDI_ERROR);rn wndclass1.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);rn wndclass1.lpszMenuName="大爷";rn wndclass1.lpszClassName="杂碎";rn if(!RegisterClass(&wndclass1))rn rn MessageBeep(0); return FALSE;rn rn hwnd=CreateWindow("杂碎","大爷",WS_OVERLAPPEDWINDOW,0,0,600,400, NULL,NULL,hInstance,NULL);rn ShowWindow(hwnd,nCmdShow); rn UpdateWindow(hwnd); while(GetMessage(&msg,NULL,0,0))rnrnTranslateMessage(&msg);rnDispatchMessage(&msg); rnrnLRESULT CALLBACK Winsunproc(rn HWND hwnd, rn UINT uMsg, rn WPARAM wParam, rn LPARAM lParam rn )rn rnbool nUpKeyDown,nCtrlkeyDown,nShiftKeyDown,nCtrlAkeyDown,nShiftBKeyDwon;rnHDC hdc;rnPAINTSTRUCT ps;rnHPEN hpen;rnHBRUSH hbrush;rnswitch(uMsg)rnrncase WM_KEYDOWN:rnswitch(wParam)rn rn case VK_UP:rn nUpKeyDown=true; rn break;rn case VK_CONTROL:rn nCtrlKeyDown=true;rn break;rn case VK_SHIFT:rn nShiftKeyDown=true;rn break;rn default:rn break;rn rnrncase WM_KEYUP:rnInvalidateRect(hwnd,NULL,FALSE);rncase WM_CHAR:rnif(wParam=(65&VK_CONTROL))rnrn if(nCtrlkeyDown=true)rn nCtrlAKeyDown=true;rn nCtrlkeyDown=false;rn nCtrlAKeydOWN=false;rnrnrnif(wParam=98 | wParam=66)rn if(nShiftKeyDown=true)rn nShiftBKeyDwon=true;rn nShiftKeyDown=false;rn break;rnrncase WM_PAINT;rnrnhdc=BeginPaint(hwnd,&ps);rnhpen=(HPEN)GetStockObject(WHITE_PEN);rnhbrush=(HBRUSH)GetStockObject(WHITE_BRUSH);rnSelectObject(hdc,hpen);rnSelectObject(hdc,hbrush);rnSetTextColor(hdc,RGB(255,0,255));rnif(nUpKeyDown==true)rnRectangle(hdc,0,0,600,400);rnTextOut(hdc,0,0,str1,strlen(str1));rnnUpKeyDown=false;rnif(nCtrlKeyDown==true&&nCtrlAkeyDown=false)rnrnRectangle(hdc,0,0,600,400);rnTextOut(hdc,0,0,str3,strlen(str3));rnnCtelKeyDown=false;rnnCtrlAkeyDown=false;rnrnif(nShiftKeyDown==true&&nShiftBKeyDwon=false)rnrnRectangle(hdc,0,0,600,400);rnTextOut(hdc,0,0,str4,strlen(str4));rnnShiftKeyDown=false;rnnShiftBKeyDwon=false;rnrnif(nCtrlAkeyDown==true)rnrnRectangle(hdc,0,0,600,400);rnTextOut(hdc,0,0,str5,strlen(str5));rnnCtrlAkeyDown=true;rnrnif(nShiftBKeyDwon==true)rnrnRectangle(hdc,0,0,600,400);rnTextOut(hdc,0,0,str6,strlen(str6));rnnShiftBKeyDwon=false;rnrnDeleteObject(hbrush);rnDeleteObject(hpen);rnEndPaint(hwnd,&ps);rnbreak;rnrncase WM_DESTROY: rnPostQuitMessage(0);rnreturn 0;rndefault:rnreturn(DefWindowProc(hwnd,uMsg,wParam,lParam));rnrnreturn 0;rnrn: error C2065: 'nCtrlAKeyDown' : undeclared identifierrn: error C2065: 'nCtrlAKeydOWN' : undeclared identifierrn: error C2106: '=' : left operand must be l-valuern: error C2143: syntax error : missing ':' before ';'rn: error C2106: '=' : left operand must be l-valuern : error C2065: 'nCtelKeyDown' : undeclared identifierrnD: error C2106: '=' : left operand must be l-valuern: fatal error C1004: unexpected end of file found
变量未定义?明明定义了啊~
请教大家一个低级问题~rn我在c函数中定义了一个int i作为循环变量,但编译通不过,说是未声明变量;rn如果放在外面定义为全局变量的话,就能行了~rn很疑惑rn函数如下,动态建立单链表:rntypedef struct Lnodernrn ElemType data;//ElemType 已定义为 intrn struct Lnode *next;rnLnode;rnrnLnode *create(ElemType a[],int length)rnrn Lnode *head=(Lnode*)malloc(sizeof(Lnode)),*p;rn head->next=NULL;rn int i; //error C2143: syntax error : missing ';' before 'type'rn printf("l=%d\n",length);rn for(i=length-1;i>=0;i--) //error C2065:'i' : undeclared identifierrn rn p=(Lnode*)malloc(sizeof(Lnode));rn p->data=a[i];rn p->next=head->next;rn head->next=p;rn rn return head;rnrn非常困惑~
★★★_我的Data控件怎么查不了变量_★★★
Data1.Recordset.FindFirst "StuName=" & "" & Text1.Text & ""rn If Data1.Recordset.NoMatch Thenrn MsgBox ("没找到!")rn Data1.Recordset.Bookmark = bm rn End Ifrn运行它就说那个Text1.Text变量不匹配,我把Text1.Text换成常量"张三"就不会出错,我也试过用变量: Dim Name As Stringrn Name = "张三",再去查Name,也报错,这是怎么回事啊???
java里面定义变量
                                                                                       定义变量  
变量未定义:
Private Sub Text47_Change()rn If KeyCode = vbKeyReturn Thenrn Text48.SetFocusrn End IfrnEnd Subrnrn工程运行到KEYCODE时提示:rn编义错误rn变量未定义rn在线等待!急!rnrn
with 变量未定义
公共模块:rnPublic Function ExecuteSQL(ByVal SQL As String, MsgString As String) As ADODB.RecordsetrnDim cnn As ADODB.ConnectionrnDim rst As ADODB.RecordsetrnDim sTokens() As StringrnOn Error GoTo ExecuteSQL_ErrorrnsTokens = Split(SQL)rnSet cnn = New ADODB.Connectionrncnn.Open ConnectStringrnIf InStr("insert,delete,update", UCase$(sTokens(0))) Thenrncnn.Execute SQLrnMsgString = sTokens(0) & "query successful"rnElsernSet rst = New ADODB.Recordsetrnrst.Open Trim$(SQL), cnn, adOpenKeyset, adLockOptimisticrnrst.MoveLastrnrst.GetRowsrnrnSet ExecuteSQL = rstrnMsgString = "查询到" & rst.RecordCount & "条记录"rn End IfrnExecuteSQL_Exit:rn Set rst = Nothingrn Set cnn = NothingrnExit FunctionrnExecuteSQL_Error:rn MsgString = "查询错误:" & Err.Descriptionrn Resume ExecuteSQL_ExitrnEnd FunctionrnPublic Function ConnectString() As StringrnConnectString = "FileDSN=Study.dsn;UID=Administrator;PWD="rnrnrnEnd FunctionrnrnPublic Function testtxt(txt As String) As BooleanrnIf Trim(txt) = "" Thenrn testtxt = FalsernElsern testtxt = TruernEnd IfrnrnEnd Functionrn查询代码:rnPrivate Sub Command1_Click()rnDim txtSQL As StringrnDim MsgText As StringrnDim sMeg As StringrnrnDim dd(4) As BooleanrnDim mrc As ADODB.RecordsetrntxtSQL = "select Student.*,Choice.Coursenum,Choice.Score from Student inner join Choice on Student.Snum=Choice.Snum where"rnIf Option1.Value Thenrn If Trim(Text1.Text) = "" Thenrn sMeg = "学号不能为空"rn MsgBox sMeg, vbOKOnly + vbExclamation, "警告"rn Text1.SetFocusrnExit SubrnElsern If Not IsNumeric(Trim(Text1.Text)) Thenrn MsgBox "请输入数字!", vbOKOnly + vbExclamation, "警告"rnExit SubrnText1.SetFocusrn End Ifrndd(0) = TruerntxtSQL = txtSQL & " Student.Snum='" & Trim(Text1.Text) & "'and Choice.Snum='" & Trim(Text1.Text) & "'"rn End IfrnEnd Ifrn If Not (dd(0) Or dd(1) Or dd(2) Or dd(3)) ThenrnMsgBox "请设置查询方式!", vbOKOnly + vbExclamation, "警告"rnExit Subrn End IfrnSet mrc = ExecuteSQL(txtSQL, MsgText)rnWith MSFlexGrid1rn .Rows = 2rn .CellAlignment = 4rn .TextMatrix(1, 0) = "Snum"rn .TextMatrix(1, 1) = "Classnum"rn .TextMatrix(1, 2) = "Sname"rn .TextMatrix(1, 3) = "Ssex"rn .TextMatrix(1, 4) = "Sbirthday"rn .TextMatrix(1, 5) = "Coursenum"rn .TextMatrix(1, 6) = "Score"rn Do While Not mrc.EOFrn .Rows = .Rows + 1rn .CellAlignment = 4rn .TextMatrix(.Rows - 1, 0) = mrc.Fields(0)rn .TextMatrix(.Rows - 1, 1) = mrc.Fields(1)rn .TextMatrix(.Rows - 1, 2) = mrc.Fields(2)rn .TextMatrix(.Rows - 1, 3) = mrc.Fields(3)rn .TextMatrix(.Rows - 1, 4) = Format(mrc.Fields(4), "yyyy-mm-dd")rn .TextMatrix(.Rows - 1, 5) = mrc.Fields(5)rn .TextMatrix(.Rows - 1, 6) = mrc.Fields(6)rn mrc.MoveNextrn LooprnEnd Withrnmrc.ClosernEnd Subrn查询的时候老是说WITH变量未定义是什么原因啊rnrn
变量未定义?
我在代码中建立一个变量,类型是Collection,但是在编译的时候,VFPrn提示我变量未定义?请问要如何解决?代码如下:rnrnloCollection As CollectionrnloCollection = Newojbect("Collection")rnrn难道集合不是这样定义的吗?
未定义的变量!
源代码!rnrnfunction OpenDB($SQL)rn$link = mysql_connect($server_DB, $user_DB, $password_DB)or die("Could not connect:".mysql_error());rnmysql_select_db($database_DB, $link);rn$result = mysql_query($SQL);rnreturn $result;rnrnrnOpenDB("select * from config WHERE ID = 1");rn$row = mysql_fetch_array($result);rnecho $row["className"];rnrn错误提示!rnNotice: Undefined variable: result in E:\wwwroot\include\config.int.php on line 36rnWarning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\wwwroot\include\config.int.php on line 36
为什么定义变量的时候总是出错?
我在按钮的clicked事件中写了一些代码,可是第一句integer mcount系统总是说语法错误,不过原来从来没有这样的问题,就是今天,真奇怪,请问高手这是怎么了?
在CMainFrame中定义Public变量,为什么在CView中用,却提示未定义变量
在CMainFrame中定义Public变量,为什么在CView中用,却提示未定义变量
变量未定义
$_rnd_code = 4;rnrnfor ($i=0;$i<$_rnd_code;$i++) rn $_nmsg .= dechex(mt_rand(0,15));rnrnrnecho"$_nmsg";
为什么总是提示No data found
在JSP中用桥接器连接SQL Server2000数据库,为什么回总是出现No data found这个问题呢,
为什么会出现变量未定义
我使用了两个页面:table.php和deal.php rnrntable.php:rnrn rn 表单提交 rn rn rn rn输入你认为好的歌星: rn rn rn rn rnrnrndeal.php:rnrnrnrn"; rn?>rnrnrn当在table.php页面文本框里输入名字时,在浏览器里怎么会输出这些东西:rnrnrnNotice: Undefined variable: start in c:\apache\htdocs\deal.php on line 5rnrnNotice: Undefined variable: start,对吗? in c:\apache\htdocs\deal.php on line 10rn你喜欢rnrnrn请帮个忙,谢谢啦!rnrn
为什么我不能在Data breakpoint输入变量的名字?
它只允许我输入地址
为什么总提示变量未定义
做一个添加的表单处理,代码如下:rn<%rnFunction GetExpress_Option(CurrentExpressID)rn Dim strExpress, rsExpress,Express,ExpressIDrn Set rsExpress = Conn.Execute("select ExpressID,Express from PE_Express where ExpressID not in (-1) order by ExpressID asc")rn Do While Not rsExpress.EOFrn strExpress = strExpress & "" & rsExpress(1) & ""rn rsExpress.MoveNextrn Looprn rsExpress.Closern Set rsExpress = Nothingrn rn GetExpress_Option = strExpressrnEnd FunctionrnrnSub ExpressYewuAdd()rn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " 添加快递业务" & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " 快递业务名称: " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " 所属快递公司: " & vbCrLfrn[color=#FF00FF] Response.Write " " & GetExpress_Option(ExpressID) & " " & vbCrLf[/color]rn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write " " & vbCrLfrn Response.Write ExpressSearchrnEnd SubrnrnrnSub SaveExpressYewuAdd()rn Dim Express, ExpressID,sql, rsrn Express = ReplaceBadChar(Trim(Request.Form("Expyewu")))rn If Express = "" Thenrn FoundErr = Truern ErrMsg = ErrMsg & "请填写快递业务名称!"rn Exit Subrn End Ifrn Set rs = Server.CreateObject("adodb.recordset")rn sql = "select * from PE_Expyewu where Expyewu='" & Express & "'"rn rs.Open sql, Conn, 1, 3rn If rs.EOF And rs.BOF Thenrn rs.AddNewrn rs("Expyewu") = Expyewurn rs("ExpressID") = ExpressIDrn rs.Updatern Call WriteSuccessMsg("快递业务添加成功!", ComeUrl)rn Elsern FoundErr = Truern ErrMsg = ErrMsg & " 您输入的快递业务已经存在。"rn End Ifrn rs.Closern Set rs = NothingrnEnd Subrn%>rn运行时总提示:rnrnMicrosoft VBScript 运行时错误 错误 '800a01f4' rn变量未定义: 'ExpressID' rnrn/Admin_ExpressYewu.asp,行 165 rn行 165 代码就是 Response.Write " " & GetExpress_Option(ExpressID) & " " & vbCrLfrn不知道问题出在哪里,请教高手了。rn
怎么总显示变量未定义???
目前函数是这样的:rnPrivate Sub mnuopen_Click()rnrnopenfile.DialogTitle = "选择音乐文件"rnrnopenfile.filename = ""rn……rn这个函数是对照着书本上来的饿。看案例操作可行,但是实际在运作起来的时候显示[color=#FF00FF]openfile[/color]变量未定义……rn仔细对照教案上的函数是一致的……rn rnrn大侠请指点……
变量定义与const变量定义
变量定义与const变量定义 一般变量1)一个整型数 int a2)一个指向整型数的指针 int *a3)一个指向指针的指针,它指向的指针是一个整型数int **a4)一个有10个整型数的数组 int a[10]5)一个有10个指针的数组,该指针指向一个整型数 int *a[10]6)一个指向有10个整型数数组的指针 int (*a)[10]7)一个指向函数的指针,该函数有一个整型参数并返回一个整型
ddd
ddd
我的存储过程报错:变量未定义?怎么回事啊?我明明定义了。
CREATE PROCEDURE dbo.q_queryNearbyPointByType3rn @viewtype varchar(200),rn @my_mpX numeric(10,0),rn @my_mpY numeric(10,0) rn asrn set nocount onrn declare @sql varchar(4000)rn declare @tb_point table(id int identity(1,1),mid int)rn insert into @tb_point (mid) select top 9 mps_id from mp_pointSplitInfo order by ((mps_x - @my_mpX )*(mps_x - @my_mpX )+(mps_Y - @my_mpY)*(mps_Y - @my_mpY ))rnrn set @sql = 'SELECT top 15 mp_id, mp_name, mp_X, mp_Y, mp_picture, mp_url,mp_address, mp_memo,mp_isrest_flag,1 as typestr FROM [地图点-商业] WHERE mp_areaId in ( select mid from '+@tb_point+' )'rn exec(@sql)rngornrn老是报错@tb_point未定义,我已经定义了啊,怎么回事?
vue mounted里面的变量传到data里面
data(){ return{ crux:[] //声明下变量 } }, mounted:function(){ var cruxs = localStorage.historyItems.split(&quot;,&quot;); this.crux = cruxs; //把需要绑定的变量,赋值给data里...
为什么老显示key_value 未定义 ,data数组也有问题??
/***************************************************n本程序是要用单片机做一个计算器n*************************************************/nn#includen#includen#define GPIO_key P2n#define GPIO_zu P0//位选n#define GPIO_led P1//段选nnunsigned char zu[8]=0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f;nunsigned char LED_data[10]=0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,n 0x7f,0x6f;nunsigned char LED_num[9];nunsigned char flag;nnvoid display_num();//用来显示每次按键之后的key_valuenvoid dispay_r(unsigned int r);//用来显示结果nvoid delayms(unsigned int i);//延时函数nchar keypress();//扫描矩阵键盘nint jisuan();nn unsigned char data[17];//全局存储数组 存储键值n //MAIN.C(23): error C141: syntax error near '['n unsigned char p;//用于 计算函数 和 出栈显示 的下标n //uchar p_stack;//用于显示数字的下标nvoid main()nn int i;n int res;n p=-1;n n unsigned char key_value;n //MAIN.C(32): error C141: syntax error near 'unsigned'n for(i=0;i<10;i++)n n LED_num[i]=LED_data[i];n n flag=0;//标记是否有键值n while(1)n n loop:n key_value=keypress();//修改flag,输出键值n //MAIN.C(32): error C202: 'key_value': undefined identifiern if(flag==1)//当flag=1时,表示有键值输入n n if (p<=17)//入队操作n n p++;n n data[p]=key_value;n n if (key_value>-1&&key_value<10)n n display_num();// display each num;n n else if (key_value=='=')n n res=jisuan();n dispay_r(res);n n else goto loop;n //判断key_valuen n flag=0;n nnint jisuan()nn unsigned int num[2]=0,0;n unsigned char fuhao;n int i=0;n for (;p>-1;p--)n n if (data[p]>-1&&data[p]<10)n//MAIN.C(71): error C141: syntax error near 'data'nn num[i]=data[p]+num[i]*10;nn n elsen n i++;n fuhao=data[p];n n n switch(fuhao)n n case '+':num[1]=num[0]+num[1];break;nn case '-':num[1]=num[0]-num[1];break;n case '*':num[1]=num[0]*num[1];break;n case '/':num[1]=num[0]/num[1];break;n n return num[1];nn nchar keypress()n unsigned char temp,key;n GPIO_key=0xfe;n temp=temp&0xf0;n if (temp!=0xf0)n n delayms(10);n temp=GPIO_key;n if (temp!=0xf0)n n flag=1;n temp=GPIO_key;n switch(temp)n n case 0xee:key=0;break;n case 0xde:key=1;break;n case 0xbe:key=2;break;n case 0x7e:key=3;break;nn n while(temp!=0xf0)n n temp=GPIO_key;n temp=temp&0xf0;n n n n GPIO_key=0xfd;n temp=temp&0xf0;n if (temp!=0xf0)n n delayms(10);n temp=GPIO_key;n if (temp!=0xf0)n n flag=1;n temp=GPIO_key;n switch(temp)n n case 0xed:key=4;break;n case 0xdd:key=5;break;n case 0xbd:key=6;break;n case 0x7d:key=7;break;nn n while(temp!=0xf0)n n temp=GPIO_key;n temp=temp&0xf0;n n n n GPIO_key=0xfb;n temp=temp&0xf0;n if (temp!=0xf0)n n delayms(10);n temp=GPIO_key;n if (temp!=0xf0)n n flag=1;n temp=GPIO_key;n switch(temp)n n case 0xeb:key=8;break;n case 0xdb:key=9;break;n case 0xbb:key='+';break;n case 0x7b:key='-';break;nn n while(temp!=0xf0)n n temp=GPIO_key;n temp=temp&0xf0;n n n n GPIO_key=0xf7;n temp=temp&0xf0;n if (temp!=0xf0)n n delayms(10);n temp=GPIO_key;n if (temp!=0xf0)n n flag=1;n temp=GPIO_key;n switch(temp)n n case 0xe7:key='*';break;n case 0xd7:key='/';break;n case 0xb7:key='=';break;n case 0x77:key='.';break;nn n while(temp!=0xf0)n n temp=GPIO_key;n temp=temp&0xf0;n n n n return key;nnvoid display_num()nn int zhi=p;n int j=0;n while(j>-1)n n if (data[zhi]>-1&&data[zhi]<10)n n GPIO_zu=zu[j];n GPIO_led=LED_num[data[zhi]];n zhi--;n j++;n n nnvoid dispay_r(unsigned int r)nn unsigned char temp_r[8];n int i;n for(i=0;i<8;i++)n n temp_r[i]=(int)r%(int)pow(10,i+1);n n for (i=0;i<8;i++)n n GPIO_zu=zu[i];n GPIO_led=LED_num[temp_r[i]];n nnvoid delayms(unsigned int i)nn unsigned char c;n for(;i>0;i--)n n for(c=110;c>0;c--);n nnn
在ddms 里面查看data/data里面的东西 不显示data/data
今天我要查看data/anr/tarces.txt,没办法,我只有root手机。 可是root之后,我发现还是不能查看或者导出traces.txt. 后来我才知道,root之后,文件夹权限没有变,所以,你都看不到。于是: adb shell-su adb chmod 777/data adb chmod 777/data/data adb chmod 777/data/anr然后重启ddm
变量未定义: 'contact' ,请问怎么定义?
请问这个问题该怎么解决:rnrnMicrosoft VBScript 运行时错误 错误 '800a01f4' rn变量未定义: 'contact' rnrn/0/down/admin/review.asp,行 68 rnrn怎样定义呢?rn rn
用变量定义变量
请教,如果我想这样做:先定义一个变量 String aStr="String aSql=\"\";"rnrn在JSP里我想把aStr做为一个java代码解析成String aSql="";rn我应该怎么做呀?或是说对aStr做什么处理?rn请高手帮忙rn
为什么这个显示“xlsbook变量没定义”
Option ExplicitrnDim xlApp As Excel.ApplicationrnDim xlbook As Excel.WorkbookrnDim xlsheet As Excel.WorksheetrnrnPrivate Sub Command1_Click()rnSet xlApp = New Excel.ApplicationrnxlApp.Visible = FalsernSet xlbook = xlApp.Workbooks.Open(App.Path & "\1.xls")rnSet xlsheet = xlbook.Worksheets(1)rnrnIf xlsbook.Sheets(1).Cells(1, 1) <> "序号" Or xlsbook.Sheets(1).Cells(1, 2) <> "商品名称" Or xlsbook.Sheets(1).Cells(1, 3) <> "价格" Thenrn MsgBox ""rnEnd IfrnEnd Subrn
变量运算,变量定义
dim dteToDate,strMemo,strSql,dteTransDate,i,intContDay,rndim intTransCode,curOverDiscrndim curTotalCost rndim curCutOverrn当我把 dim curTotalCost 该为dim curTotalCost as currency 时也会有错误rnrncurCutOver=curTotalCost*curOverDisc两个变量相乘相除,为什么会有错误阿rnrncurTotalCost curCutOver在数据库中是moneyrncurOverDisc 在数据库中是decimal(18,2)rnrn我定义的变量都是从数据库中取出来后,符值的。rnrn我看过了,变量的值是对的,但是两个相乘时就不对了(提示错误,无法显示网页)rn是否跟变量的定义又关系阿rn
为什么总是提示我已经在多处定义了某个东西?
看看下面的错误提示是什么意思?rnD:\glassesmis\common\ChinBusiness\BEmployee.cs(8): 已在多处定义“GlassesMIS.BusinessCommon”;使用“D:\glassesmis\common\BusinessCommon.cs”中的定义rn怎么解决这更问题?
index.vue 传参使用新变量的变化再重置data变量
&amp;lt;div class=&quot;picyanzhengma passwords&quot;&amp;gt; &amp;lt;div class=&quot;flex-row&quot;&amp;gt; &amp;lt;span class=&quot;tit&quot;&amp;gt;登录密码&amp;lt;/span&amp;gt;
为什么我用jqueryAjax中的$.ajax( data未定义却有序列号
[code=javascript]$(function()rn $("#check").click(function()rn alert("sss" );rn var value=$("#id").val();rn $.ajax(rn url:"servlet/UserInfoServlet",//要请求的服务器url rn //这是一个对象,表示请求的参数rn data:id:value, rn async:true, //是否为异步请求rn cache:false, //是否缓存结果rn type:"GET", //请求方式为POSTrn dataType:"json", //服务器返回的数据是什么类型 rn success:function(result) //这个方法会在服务器执行成功是被调用 ,参数result就是服务器返回的值(现在是json类型) rn if(result)rn $("label").text("好人");rn elsern $("label").text("坏人");rn rn rn )rn rn );rn rn );[/code]rnrnrn为什么我 报错的时候 会多个序列号1482198781807 ??我没有传这个参数啊 http://localhost:8080/TestWeb/servlet/UserInfoServlet?id=dc&_=1482198781807
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表

相似问题

2
spring data jpa如何自定义insert sql?批量保存数据
1
定义类的数组,若是类中存在CArray的变量,则会报错
2
我已经x1 = int(data_x1)转成int了,为什么还是报错'str' object has no attribute 'append'?
1
初学二叉树的初始化,为什么一定要定义一个指针型变量
0
oracle连接异常:“System.Data.OracleClient.OracleConnection”的类型初始值设定项引发异常。
3
在安装MySQL的过程中 中输入mysqld --initialize --console时为什么出现标注的错误的代码?
0
mnist教程中使用自己的数据,load_data该如何定义?
3
Vue请求接口获取到数据后,赋值给data后怎么刷新数据
3
微信小程序 自定义data-xxx 在后台无法获取
0
微信小程序云开发 调用云函数时,data里怎么获取变量
0
微信小程序主页面Page 调用setData之后,自定义控件里面的匿名函数对象变成null
2
表单提交multipart/form-data,获取非文件参数的问题
1
关于 keras 中用ImageDataGenerator 做 data augmentation 的问题
1
爬取下来的网页命名为wb_data,为什么wb_data.text与网页源代码内容不一样?
2
python,如何在零宽断言中的表达式exp使用变量来搜索匹配?
4
vue 无法向data中的数组中push
1
spring data rest 中的 alps data如何自定义
1
bat批处理,如何读取文本内容为变量...
1
caffe-ssd在create_data.sh的时候报错No module named numpy,可是我已经有了numpy啊!
2
python类内状态变量(是一个对象)后面加括号是什么语法