我正在尝试调用另一个文件的过程。到目前为止,我得到的结果是一个错误:
test.p
GeoQueryDataEventListener
sumWords.p
public class GeofireActivity extends AppCompatActivity {
private static final String LOG_TAG = GeofireActivity.class.getSimpleName();
private DatabaseReference refBase = null;
private DatabaseReference refLocation = null;
private DatabaseReference refUser = null;
private GeoFire geoFire = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.fragment_geofire);
this.setReferences();
}
private void setReferences() {
this.refBase = FirebaseDatabase.getInstance().getReference();
this.refUser = refBase.child("users");
this.refLocation = refBase.child("locations");
this.geoFire = new GeoFire(this.refLocation);
}
private void searchNearby(double latitude, double longitude, double radius) {
this.searchNearby(new GeoLocation(latitude, longitude), radius);
}
private void searchNearby(GeoLocation location, double radius) {
GeoQuery geoQuery = this.geoFire.queryAtLocation(location, radius);
geoQuery.addGeoQueryEventListener(new GeoQueryEventListener() {
@Override
public void onKeyEntered(String key, GeoLocation location) {
String loc = String.valueOf(location.latitude) + ", " + String.valueOf(location.longitude);
Log.d(LOG_TAG, "onKeyEntered: " + key + " @ " + loc);
/* once the key is known, one can lookup the associated record */
refUser.child(key).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
Log.d(LOG_TAG, "onDataChange: " + dataSnapshot.toString());
}
@Override
public void onCancelled(@NonNull DatabaseError firebaseError) {
Log.e(LOG_TAG, "onCancelled: " + firebaseError.getMessage());
}
});
}
@Override
public void onKeyExited(String key) {
Log.d(LOG_TAG, "onKeyExited: " + key);
}
@Override
public void onKeyMoved(String key, GeoLocation location) {
Log.d(LOG_TAG, "onKeyMoved: " + key);
}
@Override
public void onGeoQueryReady() {
Log.d(LOG_TAG, "onGeoQueryReady");
}
@Override
public void onGeoQueryError(DatabaseError error) {
Log.e(LOG_TAG, "onGeoQueryError" + error.getMessage());
}
});
}
}
test.p将参数传递给了sumWords.p,它没有任何要求。 (1005)
答案 0 :(得分:4)
您已经在“ sumWords.p”中创建了一个内部过程“ sumWords”。 sumWords.p确实不需要参数。
更改sumWords.p并删除行PROCEDURE sumWords:
和END PROCEDURE.
那样,sumWords.p需要参数。
或更改呼叫者:
DEFINE VARIABLE hSumWords AS HANDLE NO-UNDO.
RUN sumWords.p PERSISTENT SET hSumWords.
RUN sumWords IN hSumWords (INPUT "Hello", INPUT "World", OUTPUT tmp).
DELETE OBJECT hSumWords.