如何调试“对不可访问的变量使用下标”?

问题描述

这是我的代码:

export default function App() {
  const [text,setText] = React.useState(html);

  return (
    <>
      <textarea value={text} onChange={(e)=>setText(e.target.value)}/>
      <ReactQuill value={text} />
    </>
  );
}

错误是:

(“ C:\ Users \ Javad \ Desktop \ 01.au3”(7):==>在 不可访问的变量。

#RequireAdmin
#Region Directives created by AutoIt3Wrapper_GUI
#AutoIt3Wrapper_UseX64=n
#EndRegion Directives created by AutoIt3Wrapper_GUI

ListDrives("REMOVABLE")
ListDrives("FIXED")

Func ListDrives($type)
    $drive = DriveGetDrive($type)

    For $i = 1 To $drive[0]
        MsgBox(64,"",$drive[$i])
    Next

EndFunc

如何调试“对不可访问的变量使用下标”?

解决方法

也许您的驱动器不是可移动的,而是CD-ROM。 试试看一下您的驱动器。

#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3>

$re = ListDrives($DT_ALL)
_ArrayDisplay($re,'Drives and Drivetypes')
;~ ListDrives($DT_FIXED)

Func ListDrives($type)
    Local $aArray = DriveGetDrive($type)
    Local $drive_A[0][2]
    If @error Then
        ; An error occurred when retrieving the drives.
        MsgBox($MB_SYSTEMMODAL,"","It appears an error occurred.")
    Else
        For $i = 1 To $aArray[0]
            _ArrayAdd($drive_A,StringUpper($aArray[$i]) & '|' & DriveGetType($aArray[$i]))
        Next
    EndIf
    Return $drive_A
EndFunc   ;==>ListDrives

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...